<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006-2012
(c) The GRASP Project, Glasgow University, 1992-2002

-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Tc.Gen.Sig</span><span class="hs-special">(</span><span>
</span><span id="line-11"></span><span>       </span><span class="annot"><a href="GHC.Tc.Types.html#TcSigInfo"><span class="hs-identifier">TcSigInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>       </span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSigInfo"><span class="hs-identifier">TcIdSigInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSigInst"><span class="hs-identifier">TcIdSigInst</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>       </span><span class="annot"><a href="GHC.Tc.Types.html#TcPatSynInfo"><span class="hs-identifier">TcPatSynInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>       </span><span class="annot"><a href="GHC.Tc.Types.html#TcSigFun"><span class="hs-identifier">TcSigFun</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span>       </span><span class="annot"><a href="GHC.Tc.Types.html#isPartialSig"><span class="hs-identifier">isPartialSig</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#hasCompleteSig"><span class="hs-identifier">hasCompleteSig</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcIdSigName"><span class="hs-identifier">tcIdSigName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSigInfoName"><span class="hs-identifier">tcSigInfoName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>       </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#completeSigPolyId_maybe"><span class="hs-identifier">completeSigPolyId_maybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span>       </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcTySigs"><span class="hs-identifier">tcTySigs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcUserTypeSig"><span class="hs-identifier">tcUserTypeSig</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#completeSigFromId"><span class="hs-identifier">completeSigFromId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>       </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcInstSig"><span class="hs-identifier">tcInstSig</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>       </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier">TcPragEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#emptyPragEnv"><span class="hs-identifier">emptyPragEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#lookupPragEnv"><span class="hs-identifier">lookupPragEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#extendPragEnv"><span class="hs-identifier">extendPragEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>       </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#mkPragEnv"><span class="hs-identifier">mkPragEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSpecPrags"><span class="hs-identifier">tcSpecPrags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSpecWrapper"><span class="hs-identifier">tcSpecWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcImpPrags"><span class="hs-identifier">tcImpPrags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#addInlinePrags"><span class="hs-identifier">addInlinePrags</span></a></span><span>
</span><span id="line-24"></span><span>   </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.HsType.html"><span class="hs-identifier">GHC.Tc.Gen.HsType</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html"><span class="hs-identifier">GHC.Tc.Types</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html"><span class="hs-identifier">GHC.Tc.Types.Origin</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcMType.html"><span class="hs-identifier">GHC.Tc.Utils.TcMType</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Validity.html"><span class="hs-identifier">GHC.Tc.Validity</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Validity.html#checkValidType"><span class="hs-identifier">checkValidType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Unify.html"><span class="hs-identifier">GHC.Tc.Utils.Unify</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Unify.html#tcSkolemise"><span class="hs-identifier">tcSkolemise</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Unify.html#unifyType"><span class="hs-identifier">unifyType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html"><span class="hs-identifier">GHC.Tc.Utils.Instantiate</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html#topInstantiate"><span class="hs-identifier">topInstantiate</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html#tcInstTypeBndrs"><span class="hs-identifier">tcInstTypeBndrs</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html#tcLookupId"><span class="hs-identifier">tcLookupId</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#HsWrapper"><span class="hs-identifier">HsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#%3C.%3E"><span class="hs-operator">(&lt;.&gt;)</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#mkTyVarBinders"><span class="hs-identifier">mkTyVarBinders</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier">TyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Specificity"><span class="hs-identifier">Specificity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier">tyVarKind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier">binderVars</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#idName"><span class="hs-identifier">idName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#idType"><span class="hs-identifier">idType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#idInlinePragma"><span class="hs-identifier">idInlinePragma</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#setInlinePragma"><span class="hs-identifier">setInlinePragma</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier">mkLocalId</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#mkUnboundName"><span class="hs-identifier">mkUnboundName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier">getModule</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Utils</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#singleton"><span class="hs-identifier">singleton</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html#orElse"><span class="hs-identifier">orElse</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier">mapMaybe</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier">unless</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-comment">{- -------------------------------------------------------------
          Note [Overview of type signatures]
----------------------------------------------------------------
Type signatures, including partial signatures, are jolly tricky,
especially on value bindings.  Here's an overview.

    f :: forall a. [a] -&gt; [a]
    g :: forall b. _ -&gt; b

    f = ...g...
    g = ...f...

* HsSyn: a signature in a binding starts off as a TypeSig, in
  type HsBinds.Sig

* When starting a mutually recursive group, like f/g above, we
  call tcTySig on each signature in the group.

* tcTySig: Sig -&gt; TcIdSigInfo
  - For a /complete/ signature, like 'f' above, tcTySig kind-checks
    the HsType, producing a Type, and wraps it in a CompleteSig, and
    extend the type environment with this polymorphic 'f'.

  - For a /partial/signature, like 'g' above, tcTySig does nothing
    Instead it just wraps the pieces in a PartialSig, to be handled
    later.

* tcInstSig: TcIdSigInfo -&gt; TcIdSigInst
  In tcMonoBinds, when looking at an individual binding, we use
  tcInstSig to instantiate the signature forall's in the signature,
  and attribute that instantiated (monomorphic) type to the
  binder.  You can see this in GHC.Tc.Gen.Bind.tcLhsId.

  The instantiation does the obvious thing for complete signatures,
  but for /partial/ signatures it starts from the HsSyn, so it
  has to kind-check it etc: tcHsPartialSigType.  It's convenient
  to do this at the same time as instantiation, because we can
  make the wildcards into unification variables right away, raather
  than somehow quantifying over them.  And the &quot;TcLevel&quot; of those
  unification variables is correct because we are in tcMonoBinds.


Note [Scoped tyvars]
~~~~~~~~~~~~~~~~~~~~
The -XScopedTypeVariables flag brings lexically-scoped type variables
into scope for any explicitly forall-quantified type variables:
        f :: forall a. a -&gt; a
        f x = e
Then 'a' is in scope inside 'e'.

However, we do *not* support this
  - For pattern bindings e.g
        f :: forall a. a-&gt;a
        (f,g) = e

Note [Binding scoped type variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The type variables *brought into lexical scope* by a type signature
may be a subset of the *quantified type variables* of the signatures,
for two reasons:

* With kind polymorphism a signature like
    f :: forall f a. f a -&gt; f a
  may actually give rise to
    f :: forall k. forall (f::k -&gt; *) (a:k). f a -&gt; f a
  So the sig_tvs will be [k,f,a], but only f,a are scoped.
  NB: the scoped ones are not necessarily the *initial* ones!

* Even aside from kind polymorphism, there may be more instantiated
  type variables than lexically-scoped ones.  For example:
        type T a = forall b. b -&gt; (a,b)
        f :: forall c. T c
  Here, the signature for f will have one scoped type variable, c,
  but two instantiated type variables, c' and b'.

However, all of this only applies to the renamer.  The typechecker
just puts all of them into the type environment; any lexical-scope
errors were dealt with by the renamer.

-}</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
             Utility functions for TcSigInfo
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcIdSigName"><span class="hs-identifier hs-type">tcIdSigName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSigInfo"><span class="hs-identifier hs-type">TcIdSigInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-150"></span><span id="tcIdSigName"><span class="annot"><span class="annottext">tcIdSigName :: TcIdSigInfo -&gt; Name
</span><a href="GHC.Tc.Gen.Sig.html#tcIdSigName"><span class="hs-identifier hs-var hs-var">tcIdSigName</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#CompleteSig"><span class="hs-identifier hs-type">CompleteSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sig_bndr :: TcIdSigInfo -&gt; TcId
</span><a href="GHC.Tc.Types.html#sig_bndr"><span class="hs-identifier hs-var">sig_bndr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117983"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117983"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117983"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-151"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcIdSigName"><span class="hs-identifier hs-var">tcIdSigName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#PartialSig"><span class="hs-identifier hs-type">PartialSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psig_name :: TcIdSigInfo -&gt; Name
</span><a href="GHC.Tc.Types.html#psig_name"><span class="hs-identifier hs-var">psig_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117980"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117980"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117980"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSigInfoName"><span class="hs-identifier hs-type">tcSigInfoName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcSigInfo"><span class="hs-identifier hs-type">TcSigInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-154"></span><span id="tcSigInfoName"><span class="annot"><span class="annottext">tcSigInfoName :: TcSigInfo -&gt; Name
</span><a href="GHC.Tc.Gen.Sig.html#tcSigInfoName"><span class="hs-identifier hs-var hs-var">tcSigInfoName</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSig"><span class="hs-identifier hs-type">TcIdSig</span></a></span><span>     </span><span id="local-6989586621681117978"><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681117978"><span class="hs-identifier hs-var">idsi</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo -&gt; Name
</span><a href="GHC.Tc.Gen.Sig.html#tcIdSigName"><span class="hs-identifier hs-var">tcIdSigName</span></a></span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681117978"><span class="hs-identifier hs-var">idsi</span></a></span><span>
</span><span id="line-155"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSigInfoName"><span class="hs-identifier hs-var">tcSigInfoName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#TcPatSynSig"><span class="hs-identifier hs-type">TcPatSynSig</span></a></span><span> </span><span id="local-6989586621681117976"><span class="annot"><span class="annottext">TcPatSynInfo
</span><a href="#local-6989586621681117976"><span class="hs-identifier hs-var">tpsi</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcPatSynInfo -&gt; Name
</span><a href="GHC.Tc.Types.html#patsig_name"><span class="hs-identifier hs-var hs-var">patsig_name</span></a></span><span> </span><span class="annot"><span class="annottext">TcPatSynInfo
</span><a href="#local-6989586621681117976"><span class="hs-identifier hs-var">tpsi</span></a></span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#completeSigPolyId_maybe"><span class="hs-identifier hs-type">completeSigPolyId_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcSigInfo"><span class="hs-identifier hs-type">TcSigInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span>
</span><span id="line-158"></span><span id="completeSigPolyId_maybe"><span class="annot"><span class="annottext">completeSigPolyId_maybe :: TcSigInfo -&gt; Maybe TcId
</span><a href="GHC.Tc.Gen.Sig.html#completeSigPolyId_maybe"><span class="hs-identifier hs-var hs-var">completeSigPolyId_maybe</span></a></span></span><span> </span><span id="local-6989586621681117974"><span class="annot"><span class="annottext">TcSigInfo
</span><a href="#local-6989586621681117974"><span class="hs-identifier hs-var">sig</span></a></span></span><span>
</span><span id="line-159"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSig"><span class="hs-identifier hs-type">TcIdSig</span></a></span><span> </span><span id="local-6989586621681117973"><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681117973"><span class="hs-identifier hs-var">sig_info</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcSigInfo
</span><a href="#local-6989586621681117974"><span class="hs-identifier hs-var">sig</span></a></span><span>
</span><span id="line-160"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#CompleteSig"><span class="hs-identifier hs-type">CompleteSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sig_bndr :: TcIdSigInfo -&gt; TcId
</span><a href="GHC.Tc.Types.html#sig_bndr"><span class="hs-identifier hs-var">sig_bndr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117972"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117972"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681117973"><span class="hs-identifier hs-var">sig_info</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; Maybe TcId
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117972"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-161"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe TcId
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
               Typechecking user signatures
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcTySigs"><span class="hs-identifier hs-type">tcTySigs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcSigFun"><span class="hs-identifier hs-type">TcSigFun</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span id="tcTySigs"><span class="annot"><span class="annottext">tcTySigs :: [LSig GhcRn] -&gt; TcM ([TcId], TcSigFun)
</span><a href="GHC.Tc.Gen.Sig.html#tcTySigs"><span class="hs-identifier hs-var hs-var">tcTySigs</span></a></span></span><span> </span><span id="local-6989586621681117971"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117971"><span class="hs-identifier hs-var">hs_sigs</span></a></span></span><span>
</span><span id="line-172"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM ([TcId], TcSigFun) -&gt; TcM ([TcId], TcSigFun)
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM ([TcId], TcSigFun) -&gt; TcM ([TcId], TcSigFun))
-&gt; TcM ([TcId], TcSigFun) -&gt; TcM ([TcId], TcSigFun)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-173"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- Fail if any of the signatures is duff</span><span>
</span><span id="line-174"></span><span>         </span><span class="hs-comment">-- Hence mapAndReportM</span><span>
</span><span id="line-175"></span><span>         </span><span class="hs-comment">-- See Note [Fail eagerly on bad signatures]</span><span>
</span><span id="line-176"></span><span>         </span><span id="local-6989586621681117969"><span class="annot"><span class="annottext">[[TcSigInfo]]
</span><a href="#local-6989586621681117969"><span class="hs-identifier hs-var">ty_sigs_s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; TcRn [TcSigInfo])
-&gt; [LSig GhcRn] -&gt; TcRn [[TcSigInfo]]
forall a b. (a -&gt; TcRn b) -&gt; [a] -&gt; TcRn [b]
</span><a href="GHC.Tc.Utils.Monad.html#mapAndReportM"><span class="hs-identifier hs-var">mapAndReportM</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn -&gt; TcRn [TcSigInfo]
</span><a href="GHC.Tc.Gen.Sig.html#tcTySig"><span class="hs-identifier hs-var">tcTySig</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117971"><span class="hs-identifier hs-var">hs_sigs</span></a></span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681117966"><span class="annot"><span class="annottext">ty_sigs :: [TcSigInfo]
</span><a href="#local-6989586621681117966"><span class="hs-identifier hs-var hs-var">ty_sigs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[[TcSigInfo]] -&gt; [TcSigInfo]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[TcSigInfo]]
</span><a href="#local-6989586621681117969"><span class="hs-identifier hs-var">ty_sigs_s</span></a></span><span>
</span><span id="line-179"></span><span>             </span><span id="local-6989586621681117964"><span class="annot"><span class="annottext">poly_ids :: [TcId]
</span><a href="#local-6989586621681117964"><span class="hs-identifier hs-var hs-var">poly_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TcSigInfo -&gt; Maybe TcId) -&gt; [TcSigInfo] -&gt; [TcId]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">TcSigInfo -&gt; Maybe TcId
</span><a href="GHC.Tc.Gen.Sig.html#completeSigPolyId_maybe"><span class="hs-identifier hs-var">completeSigPolyId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">[TcSigInfo]
</span><a href="#local-6989586621681117966"><span class="hs-identifier hs-var">ty_sigs</span></a></span><span>
</span><span id="line-180"></span><span>                        </span><span class="hs-comment">-- The returned [TcId] are the ones for which we have</span><span>
</span><span id="line-181"></span><span>                        </span><span class="hs-comment">-- a complete type signature.</span><span>
</span><span id="line-182"></span><span>                        </span><span class="hs-comment">-- See Note [Complete and partial type signatures]</span><span>
</span><span id="line-183"></span><span>             </span><span id="local-6989586621681117963"><span class="annot"><span class="annottext">env :: NameEnv TcSigInfo
</span><a href="#local-6989586621681117963"><span class="hs-identifier hs-var hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, TcSigInfo)] -&gt; NameEnv TcSigInfo
forall a. [(Name, a)] -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#mkNameEnv"><span class="hs-identifier hs-var">mkNameEnv</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcSigInfo -&gt; Name
</span><a href="GHC.Tc.Gen.Sig.html#tcSigInfoName"><span class="hs-identifier hs-var">tcSigInfoName</span></a></span><span> </span><span class="annot"><span class="annottext">TcSigInfo
</span><a href="#local-6989586621681117961"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcSigInfo
</span><a href="#local-6989586621681117961"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681117961"><span class="annot"><span class="annottext">TcSigInfo
</span><a href="#local-6989586621681117961"><span class="hs-identifier hs-var">sig</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcSigInfo]
</span><a href="#local-6989586621681117966"><span class="hs-identifier hs-var">ty_sigs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([TcId], TcSigFun) -&gt; TcM ([TcId], TcSigFun)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117964"><span class="hs-identifier hs-var">poly_ids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameEnv TcSigInfo -&gt; TcSigFun
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv TcSigInfo
</span><a href="#local-6989586621681117963"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcTySig"><span class="hs-identifier hs-type">tcTySig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Types.html#TcSigInfo"><span class="hs-identifier hs-type">TcSigInfo</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-188"></span><span id="tcTySig"><span class="annot"><span class="annottext">tcTySig :: LSig GhcRn -&gt; TcRn [TcSigInfo]
</span><a href="GHC.Tc.Gen.Sig.html#tcTySig"><span class="hs-identifier hs-var hs-var">tcTySig</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#IdSig"><span class="hs-identifier hs-type">IdSig</span></a></span><span> </span><span class="annot"><span class="annottext">XIdSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117957"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117957"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681117956"><span class="annot"><span class="annottext">ctxt :: UserTypeCtxt
</span><a href="#local-6989586621681117956"><span class="hs-identifier hs-var hs-var">ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#FunSigCtxt"><span class="hs-identifier hs-var">FunSigCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117957"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-190"></span><span>                    </span><span class="hs-comment">-- False: do not report redundant constraints</span><span>
</span><span id="line-191"></span><span>                    </span><span class="hs-comment">-- The user has no control over the signature!</span><span>
</span><span id="line-192"></span><span>             </span><span id="local-6989586621681117954"><span class="annot"><span class="annottext">sig :: TcIdSigInfo
</span><a href="#local-6989586621681117954"><span class="hs-identifier hs-var hs-var">sig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; TcId -&gt; TcIdSigInfo
</span><a href="GHC.Tc.Gen.Sig.html#completeSigFromId"><span class="hs-identifier hs-var">completeSigFromId</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117956"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117957"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-193"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcSigInfo] -&gt; TcRn [TcSigInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcIdSigInfo -&gt; TcSigInfo
</span><a href="GHC.Tc.Types.html#TcIdSig"><span class="hs-identifier hs-var">TcIdSig</span></a></span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681117954"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcTySig"><span class="hs-identifier hs-var">tcTySig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117953"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117953"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="annot"><span class="annottext">XTypeSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117951"><span class="annot"><span class="annottext">[Located (IdP GhcRn)]
</span><a href="#local-6989586621681117951"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681117950"><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681117950"><span class="hs-identifier hs-var">sig_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcRn [TcSigInfo] -&gt; TcRn [TcSigInfo]
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117953"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn [TcSigInfo] -&gt; TcRn [TcSigInfo])
-&gt; TcRn [TcSigInfo] -&gt; TcRn [TcSigInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-197"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681117948"><span class="annot"><span class="annottext">[TcIdSigInfo]
</span><a href="#local-6989586621681117948"><span class="hs-identifier hs-var">sigs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[IOEnv (Env TcGblEnv TcLclEnv) TcIdSigInfo]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [TcIdSigInfo]
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; LHsSigWcType GhcRn
-&gt; Maybe Name
-&gt; IOEnv (Env TcGblEnv TcLclEnv) TcIdSigInfo
</span><a href="GHC.Tc.Gen.Sig.html#tcUserTypeSig"><span class="hs-identifier hs-var">tcUserTypeSig</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117953"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681117950"><span class="hs-identifier hs-var">sig_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Maybe Name
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117946"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>                          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117946"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117946"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681117951"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-199"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcSigInfo] -&gt; TcRn [TcSigInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcIdSigInfo -&gt; TcSigInfo) -&gt; [TcIdSigInfo] -&gt; [TcSigInfo]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo -&gt; TcSigInfo
</span><a href="GHC.Tc.Types.html#TcIdSig"><span class="hs-identifier hs-var">TcIdSig</span></a></span><span> </span><span class="annot"><span class="annottext">[TcIdSigInfo]
</span><a href="#local-6989586621681117948"><span class="hs-identifier hs-var">sigs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcTySig"><span class="hs-identifier hs-var">tcTySig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117945"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117945"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-type">PatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117943"><span class="annot"><span class="annottext">[Located (IdP GhcRn)]
</span><a href="#local-6989586621681117943"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681117942"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681117942"><span class="hs-identifier hs-var">sig_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-202"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcRn [TcSigInfo] -&gt; TcRn [TcSigInfo]
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117945"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn [TcSigInfo] -&gt; TcRn [TcSigInfo])
-&gt; TcRn [TcSigInfo] -&gt; TcRn [TcSigInfo]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-203"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681117941"><span class="annot"><span class="annottext">[TcPatSynInfo]
</span><a href="#local-6989586621681117941"><span class="hs-identifier hs-var">tpsigs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[IOEnv (Env TcGblEnv TcLclEnv) TcPatSynInfo]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [TcPatSynInfo]
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; LHsSigType GhcRn -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcPatSynInfo
</span><a href="GHC.Tc.Gen.Sig.html#tcPatSynSig"><span class="hs-identifier hs-var">tcPatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117939"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681117942"><span class="hs-identifier hs-var">sig_ty</span></a></span><span>
</span><span id="line-204"></span><span>                            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117939"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117939"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681117943"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-205"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcSigInfo] -&gt; TcRn [TcSigInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcPatSynInfo -&gt; TcSigInfo) -&gt; [TcPatSynInfo] -&gt; [TcSigInfo]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TcPatSynInfo -&gt; TcSigInfo
</span><a href="GHC.Tc.Types.html#TcPatSynSig"><span class="hs-identifier hs-var">TcPatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">[TcPatSynInfo]
</span><a href="#local-6989586621681117941"><span class="hs-identifier hs-var">tpsigs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-206"></span><span>
</span><span id="line-207"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcTySig"><span class="hs-identifier hs-var">tcTySig</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcSigInfo] -&gt; TcRn [TcSigInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcUserTypeSig"><span class="hs-identifier hs-type">tcUserTypeSig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsSigWcType"><span class="hs-identifier hs-type">LHsSigWcType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-211"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSigInfo"><span class="hs-identifier hs-type">TcIdSigInfo</span></a></span><span>
</span><span id="line-212"></span><span class="hs-comment">-- A function or expression type signature</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- Returns a fully quantified type signature; even the wildcards</span><span>
</span><span id="line-214"></span><span class="hs-comment">-- are quantified with ordinary skolems that should be instantiated</span><span>
</span><span id="line-215"></span><span class="hs-comment">--</span><span>
</span><span id="line-216"></span><span class="hs-comment">-- The SrcSpan is what to declare as the binding site of the</span><span>
</span><span id="line-217"></span><span class="hs-comment">-- any skolems in the signature. For function signatures we</span><span>
</span><span id="line-218"></span><span class="hs-comment">-- use the whole `f :: ty' signature; for expression signatures</span><span>
</span><span id="line-219"></span><span class="hs-comment">-- just the type part.</span><span>
</span><span id="line-220"></span><span class="hs-comment">--</span><span>
</span><span id="line-221"></span><span class="hs-comment">-- Just n  =&gt; Function type signature       name :: type</span><span>
</span><span id="line-222"></span><span class="hs-comment">-- Nothing =&gt; Expression type signature   &lt;expr&gt; :: type</span><span>
</span><span id="line-223"></span><span id="tcUserTypeSig"><span class="annot"><span class="annottext">tcUserTypeSig :: SrcSpan
-&gt; LHsSigWcType GhcRn
-&gt; Maybe Name
-&gt; IOEnv (Env TcGblEnv TcLclEnv) TcIdSigInfo
</span><a href="GHC.Tc.Gen.Sig.html#tcUserTypeSig"><span class="hs-identifier hs-var hs-var">tcUserTypeSig</span></a></span></span><span> </span><span id="local-6989586621681117938"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117938"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681117937"><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681117937"><span class="hs-identifier hs-var">hs_sig_ty</span></a></span></span><span> </span><span id="local-6989586621681117936"><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681117936"><span class="hs-identifier hs-var">mb_name</span></a></span></span><span>
</span><span id="line-224"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn -&gt; Bool
</span><a href="GHC.Tc.Gen.Sig.html#isCompleteHsSig"><span class="hs-identifier hs-var">isCompleteHsSig</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681117937"><span class="hs-identifier hs-var">hs_sig_ty</span></a></span><span>
</span><span id="line-225"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681117934"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117934"><span class="hs-identifier hs-var">sigma_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; LHsSigWcType GhcRn -&gt; TcM Kind
</span><a href="GHC.Tc.Gen.HsType.html#tcHsSigWcType"><span class="hs-identifier hs-var">tcHsSigWcType</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117932"><span class="hs-identifier hs-var">ctxt_F</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681117937"><span class="hs-identifier hs-var">hs_sig_ty</span></a></span><span>
</span><span id="line-226"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcuser&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117934"><span class="hs-identifier hs-var">sigma_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-227"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcIdSigInfo
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(TcIdSigInfo -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcIdSigInfo)
-&gt; TcIdSigInfo -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcIdSigInfo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-228"></span><span>         </span><span class="annot"><span class="annottext">CompleteSig :: TcId -&gt; UserTypeCtxt -&gt; SrcSpan -&gt; TcIdSigInfo
</span><a href="GHC.Tc.Types.html#CompleteSig"><span class="hs-identifier hs-type">CompleteSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sig_bndr :: TcId
</span><a href="GHC.Tc.Types.html#sig_bndr"><span class="hs-identifier hs-var">sig_bndr</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Kind -&gt; Kind -&gt; TcId
Name -&gt; Kind -&gt; Kind -&gt; TcId
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117929"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117934"><span class="hs-identifier hs-var">sigma_ty</span></a></span><span>
</span><span id="line-229"></span><span>                                   </span><span class="hs-comment">-- We use `Many' as the multiplicity here,</span><span>
</span><span id="line-230"></span><span>                                   </span><span class="hs-comment">-- as if this identifier corresponds to</span><span>
</span><span id="line-231"></span><span>                                   </span><span class="hs-comment">-- anything, it is a top-level</span><span>
</span><span id="line-232"></span><span>                                   </span><span class="hs-comment">-- definition. Which are all unrestricted in</span><span>
</span><span id="line-233"></span><span>                                   </span><span class="hs-comment">-- the current implementation.</span><span>
</span><span id="line-234"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_ctxt :: UserTypeCtxt
</span><a href="GHC.Tc.Types.html#sig_ctxt"><span class="hs-identifier hs-var">sig_ctxt</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117926"><span class="hs-identifier hs-var">ctxt_T</span></a></span><span>
</span><span id="line-235"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_loc :: SrcSpan
</span><a href="GHC.Tc.Types.html#sig_loc"><span class="hs-identifier hs-var">sig_loc</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117938"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-236"></span><span>                       </span><span class="hs-comment">-- Location of the &lt;type&gt; in   f :: &lt;type&gt;</span><span>
</span><span id="line-237"></span><span>
</span><span id="line-238"></span><span>  </span><span class="hs-comment">-- Partial sig with wildcards</span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-240"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcIdSigInfo
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PartialSig :: Name
-&gt; LHsSigWcType GhcRn -&gt; UserTypeCtxt -&gt; SrcSpan -&gt; TcIdSigInfo
</span><a href="GHC.Tc.Types.html#PartialSig"><span class="hs-identifier hs-type">PartialSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psig_name :: Name
</span><a href="GHC.Tc.Types.html#psig_name"><span class="hs-identifier hs-var">psig_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117929"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psig_hs_ty :: LHsSigWcType GhcRn
</span><a href="GHC.Tc.Types.html#psig_hs_ty"><span class="hs-identifier hs-var">psig_hs_ty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681117937"><span class="hs-identifier hs-var">hs_sig_ty</span></a></span><span>
</span><span id="line-241"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_ctxt :: UserTypeCtxt
</span><a href="GHC.Tc.Types.html#sig_ctxt"><span class="hs-identifier hs-var">sig_ctxt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117932"><span class="hs-identifier hs-var">ctxt_F</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_loc :: SrcSpan
</span><a href="GHC.Tc.Types.html#sig_loc"><span class="hs-identifier hs-var">sig_loc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117938"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-243"></span><span>    </span><span id="local-6989586621681117929"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681117929"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681117936"><span class="hs-identifier hs-var">mb_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-244"></span><span>               </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681117923"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117923"><span class="hs-identifier hs-var">n</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117923"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-245"></span><span>               </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Name
</span><a href="GHC.Builtin.Names.html#mkUnboundName"><span class="hs-identifier hs-var">mkUnboundName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkVarOcc"><span class="hs-identifier hs-var">mkVarOcc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;expression&gt;&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-246"></span><span>    </span><span id="local-6989586621681117932"><span class="annot"><span class="annottext">ctxt_F :: UserTypeCtxt
</span><a href="#local-6989586621681117932"><span class="hs-identifier hs-var hs-var">ctxt_F</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681117936"><span class="hs-identifier hs-var">mb_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-247"></span><span>               </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681117921"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117921"><span class="hs-identifier hs-var">n</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#FunSigCtxt"><span class="hs-identifier hs-var">FunSigCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117921"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-248"></span><span>               </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#ExprSigCtxt"><span class="hs-identifier hs-var">ExprSigCtxt</span></a></span><span>
</span><span id="line-249"></span><span>    </span><span id="local-6989586621681117926"><span class="annot"><span class="annottext">ctxt_T :: UserTypeCtxt
</span><a href="#local-6989586621681117926"><span class="hs-identifier hs-var hs-var">ctxt_T</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="#local-6989586621681117936"><span class="hs-identifier hs-var">mb_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-250"></span><span>               </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681117919"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117919"><span class="hs-identifier hs-var">n</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#FunSigCtxt"><span class="hs-identifier hs-var">FunSigCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117919"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-251"></span><span>               </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#ExprSigCtxt"><span class="hs-identifier hs-var">ExprSigCtxt</span></a></span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#completeSigFromId"><span class="hs-identifier hs-type">completeSigFromId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html#UserTypeCtxt"><span class="hs-identifier hs-type">UserTypeCtxt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSigInfo"><span class="hs-identifier hs-type">TcIdSigInfo</span></a></span><span>
</span><span id="line-256"></span><span class="hs-comment">-- Used for instance methods and record selectors</span><span>
</span><span id="line-257"></span><span id="completeSigFromId"><span class="annot"><span class="annottext">completeSigFromId :: UserTypeCtxt -&gt; TcId -&gt; TcIdSigInfo
</span><a href="GHC.Tc.Gen.Sig.html#completeSigFromId"><span class="hs-identifier hs-var hs-var">completeSigFromId</span></a></span></span><span> </span><span id="local-6989586621681117918"><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117918"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681117917"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117917"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CompleteSig :: TcId -&gt; UserTypeCtxt -&gt; SrcSpan -&gt; TcIdSigInfo
</span><a href="GHC.Tc.Types.html#CompleteSig"><span class="hs-identifier hs-type">CompleteSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sig_bndr :: TcId
</span><a href="GHC.Tc.Types.html#sig_bndr"><span class="hs-identifier hs-var">sig_bndr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117917"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-259"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_ctxt :: UserTypeCtxt
</span><a href="GHC.Tc.Types.html#sig_ctxt"><span class="hs-identifier hs-var">sig_ctxt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117918"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-260"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_loc :: SrcSpan
</span><a href="GHC.Tc.Types.html#sig_loc"><span class="hs-identifier hs-var">sig_loc</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; SrcSpan
forall a. NamedThing a =&gt; a -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#getSrcSpan"><span class="hs-identifier hs-var">getSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117917"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#isCompleteHsSig"><span class="hs-identifier hs-type">isCompleteHsSig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsSigWcType"><span class="hs-identifier hs-type">LHsSigWcType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-263"></span><span class="hs-comment">-- ^ If there are no wildcards, return a LHsSigType</span><span>
</span><span id="line-264"></span><span id="isCompleteHsSig"><span class="annot"><span class="annottext">isCompleteHsSig :: LHsSigWcType GhcRn -&gt; Bool
</span><a href="GHC.Tc.Gen.Sig.html#isCompleteHsSig"><span class="hs-identifier hs-var hs-var">isCompleteHsSig</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#HsWC"><span class="hs-identifier hs-type">HsWC</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hswc_ext :: forall pass thing. HsWildCardBndrs pass thing -&gt; XHsWC pass thing
</span><a href="GHC.Hs.Type.html#hswc_ext"><span class="hs-identifier hs-var">hswc_ext</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117913"><span class="annot"><span class="annottext">XHsWC GhcRn (LHsSigType GhcRn)
</span><a href="#local-6989586621681117913"><span class="hs-identifier hs-var">wcs</span></a></span></span><span>
</span><span id="line-265"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">hswc_body :: forall pass thing. HsWildCardBndrs pass thing -&gt; thing
</span><a href="GHC.Hs.Type.html#hswc_body"><span class="hs-identifier hs-var">hswc_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#HsIB"><span class="hs-identifier hs-type">HsIB</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsib_body :: forall pass thing. HsImplicitBndrs pass thing -&gt; thing
</span><a href="GHC.Hs.Type.html#hsib_body"><span class="hs-identifier hs-var">hsib_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117909"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117909"><span class="hs-identifier hs-var">hs_ty</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-266"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
XHsWC GhcRn (LHsSigType GhcRn)
</span><a href="#local-6989586621681117913"><span class="hs-identifier hs-var">wcs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="GHC.Tc.Gen.Sig.html#no_anon_wc"><span class="hs-identifier hs-var">no_anon_wc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117909"><span class="hs-identifier hs-var">hs_ty</span></a></span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#no_anon_wc"><span class="hs-identifier hs-type">no_anon_wc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsType"><span class="hs-identifier hs-type">LHsType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-269"></span><span id="no_anon_wc"><span class="annot"><span class="annottext">no_anon_wc :: GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="GHC.Tc.Gen.Sig.html#no_anon_wc"><span class="hs-identifier hs-var hs-var">no_anon_wc</span></a></span></span><span> </span><span id="local-6989586621681117905"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117905"><span class="hs-identifier hs-var">lty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117905"><span class="hs-identifier hs-var">lty</span></a></span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-271"></span><span>    </span><span id="local-6989586621681117904"><span class="annot"><span class="annottext">go :: GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117902"><span class="annot"><span class="annottext">HsType GhcRn
</span><a href="#local-6989586621681117902"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsType GhcRn
</span><a href="#local-6989586621681117902"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-272"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsWildCardTy"><span class="hs-identifier hs-type">HsWildCardTy</span></a></span><span> </span><span class="annot"><span class="annottext">XWildCardTy GhcRn
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-273"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsAppTy"><span class="hs-identifier hs-type">HsAppTy</span></a></span><span> </span><span class="annot"><span class="annottext">XAppTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117899"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117899"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681117898"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117898"><span class="hs-identifier hs-var">ty2</span></a></span></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117899"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117898"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-274"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsAppKindTy"><span class="hs-identifier hs-type">HsAppKindTy</span></a></span><span> </span><span class="annot"><span class="annottext">XAppKindTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117896"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117896"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681117895"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117895"><span class="hs-identifier hs-var">ki</span></a></span></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117896"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117895"><span class="hs-identifier hs-var">ki</span></a></span><span>
</span><span id="line-275"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsFunTy"><span class="hs-identifier hs-type">HsFunTy</span></a></span><span> </span><span class="annot"><span class="annottext">XFunTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117893"><span class="annot"><span class="annottext">HsArrow GhcRn
</span><a href="#local-6989586621681117893"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621681117892"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117892"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681117891"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117891"><span class="hs-identifier hs-var">ty2</span></a></span></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117892"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117891"><span class="hs-identifier hs-var">ty2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsArrow GhcRn -&gt; GenLocated SrcSpan (HsType GhcRn)
</span><a href="GHC.Hs.Type.html#arrowToHsType"><span class="hs-identifier hs-var">arrowToHsType</span></a></span><span> </span><span class="annot"><span class="annottext">HsArrow GhcRn
</span><a href="#local-6989586621681117893"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-276"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsListTy"><span class="hs-identifier hs-type">HsListTy</span></a></span><span> </span><span class="annot"><span class="annottext">XListTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117888"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117888"><span class="hs-identifier hs-var">ty</span></a></span></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117888"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-277"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsTupleTy"><span class="hs-identifier hs-type">HsTupleTy</span></a></span><span> </span><span class="annot"><span class="annottext">XTupleTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsTupleSort
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117886"><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117886"><span class="hs-identifier hs-var">tys</span></a></span></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
</span><a href="#local-6989586621681117885"><span class="hs-identifier hs-var">gos</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117886"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-278"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsSumTy"><span class="hs-identifier hs-type">HsSumTy</span></a></span><span> </span><span class="annot"><span class="annottext">XSumTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117883"><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117883"><span class="hs-identifier hs-var">tys</span></a></span></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
</span><a href="#local-6989586621681117885"><span class="hs-identifier hs-var">gos</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117883"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-279"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsOpTy"><span class="hs-identifier hs-type">HsOpTy</span></a></span><span> </span><span class="annot"><span class="annottext">XOpTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117881"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117881"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117880"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117880"><span class="hs-identifier hs-var">ty2</span></a></span></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117881"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117880"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-280"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsParTy"><span class="hs-identifier hs-type">HsParTy</span></a></span><span> </span><span class="annot"><span class="annottext">XParTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117878"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117878"><span class="hs-identifier hs-var">ty</span></a></span></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117878"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-281"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsIParamTy"><span class="hs-identifier hs-type">HsIParamTy</span></a></span><span> </span><span class="annot"><span class="annottext">XIParamTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Located HsIPName
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117876"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117876"><span class="hs-identifier hs-var">ty</span></a></span></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117876"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-282"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsKindSig"><span class="hs-identifier hs-type">HsKindSig</span></a></span><span> </span><span class="annot"><span class="annottext">XKindSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117874"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117874"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681117873"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117873"><span class="hs-identifier hs-var">kind</span></a></span></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117874"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117873"><span class="hs-identifier hs-var">kind</span></a></span><span>
</span><span id="line-283"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsDocTy"><span class="hs-identifier hs-type">HsDocTy</span></a></span><span> </span><span class="annot"><span class="annottext">XDocTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117871"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117871"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="annot"><span class="annottext">LHsDocString
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117871"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-284"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsBangTy"><span class="hs-identifier hs-type">HsBangTy</span></a></span><span> </span><span class="annot"><span class="annottext">XBangTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsSrcBang
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117869"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117869"><span class="hs-identifier hs-var">ty</span></a></span></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117869"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-285"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsRecTy"><span class="hs-identifier hs-type">HsRecTy</span></a></span><span> </span><span class="annot"><span class="annottext">XRecTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117867"><span class="annot"><span class="annottext">[LConDeclField GhcRn]
</span><a href="#local-6989586621681117867"><span class="hs-identifier hs-var">flds</span></a></span></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
</span><a href="#local-6989586621681117885"><span class="hs-identifier hs-var">gos</span></a></span><span> </span><span class="annot"><span class="annottext">([GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool)
-&gt; [GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(LConDeclField GhcRn -&gt; GenLocated SrcSpan (HsType GhcRn))
-&gt; [LConDeclField GhcRn] -&gt; [GenLocated SrcSpan (HsType GhcRn)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ConDeclField GhcRn -&gt; GenLocated SrcSpan (HsType GhcRn)
forall pass. ConDeclField pass -&gt; LBangType pass
</span><a href="GHC.Hs.Type.html#cd_fld_type"><span class="hs-identifier hs-var hs-var">cd_fld_type</span></a></span><span> </span><span class="annot"><span class="annottext">(ConDeclField GhcRn -&gt; GenLocated SrcSpan (HsType GhcRn))
-&gt; (LConDeclField GhcRn -&gt; ConDeclField GhcRn)
-&gt; LConDeclField GhcRn
-&gt; GenLocated SrcSpan (HsType GhcRn)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LConDeclField GhcRn -&gt; ConDeclField GhcRn
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LConDeclField GhcRn]
</span><a href="#local-6989586621681117867"><span class="hs-identifier hs-var">flds</span></a></span><span>
</span><span id="line-286"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsExplicitListTy"><span class="hs-identifier hs-type">HsExplicitListTy</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitListTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">PromotionFlag
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117862"><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117862"><span class="hs-identifier hs-var">tys</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
</span><a href="#local-6989586621681117885"><span class="hs-identifier hs-var">gos</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117862"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-287"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsExplicitTupleTy"><span class="hs-identifier hs-type">HsExplicitTupleTy</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitTupleTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117860"><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117860"><span class="hs-identifier hs-var">tys</span></a></span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
</span><a href="#local-6989586621681117885"><span class="hs-identifier hs-var">gos</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117860"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-288"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllTy"><span class="hs-identifier hs-type">HsForAllTy</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hst_tele :: forall pass. HsType pass -&gt; HsForAllTelescope pass
</span><a href="GHC.Hs.Type.html#hst_tele"><span class="hs-identifier hs-var">hst_tele</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117857"><span class="annot"><span class="annottext">HsForAllTelescope GhcRn
</span><a href="#local-6989586621681117857"><span class="hs-identifier hs-var">tele</span></a></span></span><span>
</span><span id="line-289"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">hst_body :: forall pass. HsType pass -&gt; LHsType pass
</span><a href="GHC.Hs.Type.html#hst_body"><span class="hs-identifier hs-var">hst_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117855"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117855"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsForAllTelescope GhcRn -&gt; Bool
</span><a href="GHC.Tc.Gen.Sig.html#no_anon_wc_tele"><span class="hs-identifier hs-var">no_anon_wc_tele</span></a></span><span> </span><span class="annot"><span class="annottext">HsForAllTelescope GhcRn
</span><a href="#local-6989586621681117857"><span class="hs-identifier hs-var">tele</span></a></span><span>
</span><span id="line-290"></span><span>                                        </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117855"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-291"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsQualTy"><span class="hs-identifier hs-type">HsQualTy</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hst_ctxt :: forall pass. HsType pass -&gt; LHsContext pass
</span><a href="GHC.Hs.Type.html#hst_ctxt"><span class="hs-identifier hs-var">hst_ctxt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117851"><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117851"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span>
</span><span id="line-292"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">hst_body :: forall pass. HsType pass -&gt; LHsType pass
</span><a href="GHC.Hs.Type.html#hst_body"><span class="hs-identifier hs-var">hst_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117850"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117850"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
</span><a href="#local-6989586621681117885"><span class="hs-identifier hs-var">gos</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117851"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117850"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-293"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsSpliceTy"><span class="hs-identifier hs-type">HsSpliceTy</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliceTy GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-type">HsSpliced</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliced GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ThModFinalizers
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplicedTy"><span class="hs-identifier hs-type">HsSplicedTy</span></a></span><span> </span><span id="local-6989586621681117846"><span class="annot"><span class="annottext">HsType GhcRn
</span><a href="#local-6989586621681117846"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsType GhcRn) -&gt; Bool)
-&gt; GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HsType GhcRn -&gt; GenLocated SrcSpan (HsType GhcRn)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">HsType GhcRn
</span><a href="#local-6989586621681117846"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-294"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsSpliceTy"><span class="hs-identifier hs-type">HsSpliceTy</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-295"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsTyLit"><span class="hs-identifier hs-type">HsTyLit</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-296"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsTyVar"><span class="hs-identifier hs-type">HsTyVar</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-297"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#HsStarTy"><span class="hs-identifier hs-type">HsStarTy</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-298"></span><span>      </span><span class="annot"><a href="GHC.Hs.Type.html#XHsType"><span class="hs-identifier hs-type">XHsType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#NHsCoreTy"><span class="hs-identifier hs-type">NHsCoreTy</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>      </span><span class="hs-comment">-- Core type, which does not have any wildcard</span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span>    </span><span id="local-6989586621681117885"><span class="annot"><span class="annottext">gos :: [GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
</span><a href="#local-6989586621681117885"><span class="hs-identifier hs-var hs-var">gos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsType GhcRn) -&gt; Bool)
-&gt; [GenLocated SrcSpan (HsType GhcRn)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="#local-6989586621681117904"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#no_anon_wc_tele"><span class="hs-identifier hs-type">no_anon_wc_tele</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllTelescope"><span class="hs-identifier hs-type">HsForAllTelescope</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-303"></span><span id="no_anon_wc_tele"><span class="annot"><span class="annottext">no_anon_wc_tele :: HsForAllTelescope GhcRn -&gt; Bool
</span><a href="GHC.Tc.Gen.Sig.html#no_anon_wc_tele"><span class="hs-identifier hs-var hs-var">no_anon_wc_tele</span></a></span></span><span> </span><span id="local-6989586621681117838"><span class="annot"><span class="annottext">HsForAllTelescope GhcRn
</span><a href="#local-6989586621681117838"><span class="hs-identifier hs-var">tele</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsForAllTelescope GhcRn
</span><a href="#local-6989586621681117838"><span class="hs-identifier hs-var">tele</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-304"></span><span>  </span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllVis"><span class="hs-identifier hs-type">HsForAllVis</span></a></span><span>   </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsf_vis_bndrs :: forall pass. HsForAllTelescope pass -&gt; [LHsTyVarBndr () pass]
</span><a href="GHC.Hs.Type.html#hsf_vis_bndrs"><span class="hs-identifier hs-var">hsf_vis_bndrs</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117835"><span class="annot"><span class="annottext">[LHsTyVarBndr () GhcRn]
</span><a href="#local-6989586621681117835"><span class="hs-identifier hs-var">ltvs</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(LHsTyVarBndr () GhcRn -&gt; Bool) -&gt; [LHsTyVarBndr () GhcRn] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsTyVarBndr () GhcRn -&gt; Bool
forall {flag}. HsTyVarBndr flag GhcRn -&gt; Bool
</span><a href="#local-6989586621681117834"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">(HsTyVarBndr () GhcRn -&gt; Bool)
-&gt; (LHsTyVarBndr () GhcRn -&gt; HsTyVarBndr () GhcRn)
-&gt; LHsTyVarBndr () GhcRn
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LHsTyVarBndr () GhcRn -&gt; HsTyVarBndr () GhcRn
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsTyVarBndr () GhcRn]
</span><a href="#local-6989586621681117835"><span class="hs-identifier hs-var">ltvs</span></a></span><span>
</span><span id="line-305"></span><span>  </span><span class="annot"><a href="GHC.Hs.Type.html#HsForAllInvis"><span class="hs-identifier hs-type">HsForAllInvis</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsf_invis_bndrs :: forall pass.
HsForAllTelescope pass -&gt; [LHsTyVarBndr Specificity pass]
</span><a href="GHC.Hs.Type.html#hsf_invis_bndrs"><span class="hs-identifier hs-var">hsf_invis_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117831"><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcRn]
</span><a href="#local-6989586621681117831"><span class="hs-identifier hs-var">ltvs</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(LHsTyVarBndr Specificity GhcRn -&gt; Bool)
-&gt; [LHsTyVarBndr Specificity GhcRn] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsTyVarBndr Specificity GhcRn -&gt; Bool
forall {flag}. HsTyVarBndr flag GhcRn -&gt; Bool
</span><a href="#local-6989586621681117834"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">(HsTyVarBndr Specificity GhcRn -&gt; Bool)
-&gt; (LHsTyVarBndr Specificity GhcRn
    -&gt; HsTyVarBndr Specificity GhcRn)
-&gt; LHsTyVarBndr Specificity GhcRn
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LHsTyVarBndr Specificity GhcRn -&gt; HsTyVarBndr Specificity GhcRn
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcRn]
</span><a href="#local-6989586621681117831"><span class="hs-identifier hs-var">ltvs</span></a></span><span>
</span><span id="line-306"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-307"></span><span>    </span><span id="local-6989586621681117834"><span class="annot"><span class="annottext">go :: HsTyVarBndr flag GhcRn -&gt; Bool
</span><a href="#local-6989586621681117834"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#UserTyVar"><span class="hs-identifier hs-type">UserTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">XUserTyVar GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">flag
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-308"></span><span>    </span><span class="annot"><a href="#local-6989586621681117834"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#KindedTyVar"><span class="hs-identifier hs-type">KindedTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">XKindedTyVar GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">flag
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117828"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117828"><span class="hs-identifier hs-var">ki</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; Bool
</span><a href="GHC.Tc.Gen.Sig.html#no_anon_wc"><span class="hs-identifier hs-var">no_anon_wc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117828"><span class="hs-identifier hs-var">ki</span></a></span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span class="hs-comment">{- Note [Fail eagerly on bad signatures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If a type signature is wrong, fail immediately:

 * the type sigs may bind type variables, so proceeding without them
   can lead to a cascade of errors

 * the type signature might be ambiguous, in which case checking
   the code against the signature will give a very similar error
   to the ambiguity error.

ToDo: this means we fall over if any top-level type signature in the
module is wrong, because we typecheck all the signatures together
(see GHC.Tc.Gen.Bind.tcValBinds).  Moreover, because of top-level
captureTopConstraints, only insoluble constraints will be reported.
We typecheck all signatures at the same time because a signature
like   f,g :: blah   might have f and g from different SCCs.

So it's a bit awkward to get better error recovery, and no one
has complained!
-}</span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
        Type checking a pattern synonym signature
*                                                                      *
************************************************************************

Note [Pattern synonym signatures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pattern synonym signatures are surprisingly tricky (see #11224 for example).
In general they look like this:

   pattern P :: forall univ_tvs. req_theta
             =&gt; forall ex_tvs. prov_theta
             =&gt; arg1 -&gt; .. -&gt; argn -&gt; res_ty

For parsing and renaming we treat the signature as an ordinary LHsSigType.

Once we get to type checking, we decompose it into its parts, in tcPatSynSig.

* Note that 'forall univ_tvs' and 'req_theta =&gt;'
        and 'forall ex_tvs'   and 'prov_theta =&gt;'
  are all optional.  We gather the pieces at the top of tcPatSynSig

* Initially the implicitly-bound tyvars (added by the renamer) include both
  universal and existential vars.

* After we kind-check the pieces and convert to Types, we do kind generalisation.

Note [solveEqualities in tcPatSynSig]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It's important that we solve /all/ the equalities in a pattern
synonym signature, because we are going to zonk the signature to
a Type (not a TcType), in GHC.Tc.TyCl.PatSyn.tc_patsyn_finish, and that
fails if there are un-filled-in coercion variables mentioned
in the type (#15694).

The best thing is simply to use solveEqualities to solve all the
equalites, rather than leaving them in the ambient constraints
to be solved later.  Pattern synonyms are top-level, so there's
no problem with completely solving them.

(NB: this solveEqualities wraps newImplicitTKBndrs, which itself
does a solveLocalEqualities; so solveEqualities isn't going to
make any further progress; it'll just report any unsolved ones,
and fail, as it should.)
-}</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcPatSynSig"><span class="hs-identifier hs-type">tcPatSynSig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsSigType"><span class="hs-identifier hs-type">LHsSigType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPatSynInfo"><span class="hs-identifier hs-type">TcPatSynInfo</span></a></span><span>
</span><span id="line-380"></span><span class="hs-comment">-- See Note [Pattern synonym signatures]</span><span>
</span><span id="line-381"></span><span class="hs-comment">-- See Note [Recipe for checking a signature] in GHC.Tc.Gen.HsType</span><span>
</span><span id="line-382"></span><span id="tcPatSynSig"><span class="annot"><span class="annottext">tcPatSynSig :: Name
-&gt; LHsSigType GhcRn -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcPatSynInfo
</span><a href="GHC.Tc.Gen.Sig.html#tcPatSynSig"><span class="hs-identifier hs-var hs-var">tcPatSynSig</span></a></span></span><span> </span><span id="local-6989586621681117827"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117827"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681117826"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681117826"><span class="hs-identifier hs-var">sig_ty</span></a></span></span><span>
</span><span id="line-383"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#HsIB"><span class="hs-identifier hs-type">HsIB</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsib_ext :: forall pass thing. HsImplicitBndrs pass thing -&gt; XHsIB pass thing
</span><a href="GHC.Hs.Type.html#hsib_ext"><span class="hs-identifier hs-var">hsib_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117824"><span class="annot"><span class="annottext">XHsIB GhcRn (GenLocated SrcSpan (HsType GhcRn))
</span><a href="#local-6989586621681117824"><span class="hs-identifier hs-var">implicit_hs_tvs</span></a></span></span><span>
</span><span id="line-384"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">hsib_body :: forall pass thing. HsImplicitBndrs pass thing -&gt; thing
</span><a href="GHC.Hs.Type.html#hsib_body"><span class="hs-identifier hs-var">hsib_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117823"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117823"><span class="hs-identifier hs-var">hs_ty</span></a></span></span><span> </span><span class="hs-special">}</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681117826"><span class="hs-identifier hs-var">sig_ty</span></a></span><span>
</span><span id="line-385"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117822"><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcRn]
</span><a href="#local-6989586621681117822"><span class="hs-identifier hs-var">univ_hs_tvbndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117821"><span class="annot"><span class="annottext">GenLocated SrcSpan [GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117821"><span class="hs-identifier hs-var">hs_req</span></a></span></span><span class="hs-special">,</span><span>  </span><span id="local-6989586621681117820"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117820"><span class="hs-identifier hs-var">hs_ty1</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
-&gt; ([LHsTyVarBndr Specificity GhcRn],
    GenLocated SrcSpan [GenLocated SrcSpan (HsType GhcRn)],
    GenLocated SrcSpan (HsType GhcRn))
forall pass.
LHsType pass
-&gt; ([LHsTyVarBndr Specificity pass], LHsContext pass, LHsType pass)
</span><a href="GHC.Hs.Type.html#splitLHsSigmaTyInvis"><span class="hs-identifier hs-var">splitLHsSigmaTyInvis</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117823"><span class="hs-identifier hs-var">hs_ty</span></a></span><span>
</span><span id="line-386"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117818"><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcRn]
</span><a href="#local-6989586621681117818"><span class="hs-identifier hs-var">ex_hs_tvbndrs</span></a></span></span><span class="hs-special">,</span><span>   </span><span id="local-6989586621681117817"><span class="annot"><span class="annottext">GenLocated SrcSpan [GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117817"><span class="hs-identifier hs-var">hs_prov</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117816"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117816"><span class="hs-identifier hs-var">hs_body_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
-&gt; ([LHsTyVarBndr Specificity GhcRn],
    GenLocated SrcSpan [GenLocated SrcSpan (HsType GhcRn)],
    GenLocated SrcSpan (HsType GhcRn))
forall pass.
LHsType pass
-&gt; ([LHsTyVarBndr Specificity pass], LHsContext pass, LHsType pass)
</span><a href="GHC.Hs.Type.html#splitLHsSigmaTyInvis"><span class="hs-identifier hs-var">splitLHsSigmaTyInvis</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117820"><span class="hs-identifier hs-var">hs_ty1</span></a></span><span>
</span><span id="line-387"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>  </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcPatSynSig 1&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsSigType GhcRn -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681117826"><span class="hs-identifier hs-var">sig_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-388"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117815"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117815"><span class="hs-identifier hs-var">implicit_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117814"><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117814"><span class="hs-identifier hs-var">univ_tvbndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117813"><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117813"><span class="hs-identifier hs-var">ex_tvbndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117812"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117812"><span class="hs-identifier hs-var">req</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117811"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117811"><span class="hs-identifier hs-var">prov</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117810"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117810"><span class="hs-identifier hs-var">body_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM
  ([TcId],
   ([VarBndr TcId Specificity],
    ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
-&gt; TcM
     ([TcId],
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#pushTcLevelM_"><span class="hs-identifier hs-var">pushTcLevelM_</span></a></span><span>   </span><span class="annot"><span class="annottext">(TcM
   ([TcId],
    ([VarBndr TcId Specificity],
     ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
 -&gt; TcM
      ([TcId],
       ([VarBndr TcId Specificity],
        ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))))
-&gt; TcM
     ([TcId],
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
-&gt; TcM
     ([TcId],
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-390"></span><span>              </span><span class="annot"><span class="annottext">TcM
  ([TcId],
   ([VarBndr TcId Specificity],
    ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
-&gt; TcM
     ([TcId],
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Solver.html#solveEqualities"><span class="hs-identifier hs-var">solveEqualities</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM
   ([TcId],
    ([VarBndr TcId Specificity],
     ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
 -&gt; TcM
      ([TcId],
       ([VarBndr TcId Specificity],
        ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))))
-&gt; TcM
     ([TcId],
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
-&gt; TcM
     ([TcId],
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-comment">-- See Note [solveEqualities in tcPatSynSig]</span><span>
</span><span id="line-391"></span><span>              </span><span class="annot"><span class="annottext">[Name]
-&gt; TcM
     ([VarBndr TcId Specificity],
      ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))
-&gt; TcM
     ([TcId],
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
forall a. [Name] -&gt; TcM a -&gt; TcM ([TcId], a)
</span><a href="GHC.Tc.Gen.HsType.html#bindImplicitTKBndrs_Skol"><span class="hs-identifier hs-var">bindImplicitTKBndrs_Skol</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
XHsIB GhcRn (GenLocated SrcSpan (HsType GhcRn))
</span><a href="#local-6989586621681117824"><span class="hs-identifier hs-var">implicit_hs_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM
   ([VarBndr TcId Specificity],
    ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))
 -&gt; TcM
      ([TcId],
       ([VarBndr TcId Specificity],
        ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))))
-&gt; TcM
     ([VarBndr TcId Specificity],
      ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))
-&gt; TcM
     ([TcId],
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-392"></span><span>              </span><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcRn]
-&gt; TcM ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))
-&gt; TcM
     ([VarBndr TcId Specificity],
      ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))
forall flag a.
OutputableBndrFlag flag =&gt;
[LHsTyVarBndr flag GhcRn] -&gt; TcM a -&gt; TcM ([VarBndr TcId flag], a)
</span><a href="GHC.Tc.Gen.HsType.html#bindExplicitTKBndrs_Skol"><span class="hs-identifier hs-var">bindExplicitTKBndrs_Skol</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcRn]
</span><a href="#local-6989586621681117822"><span class="hs-identifier hs-var">univ_hs_tvbndrs</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))
 -&gt; TcM
      ([VarBndr TcId Specificity],
       ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))))
-&gt; TcM ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))
-&gt; TcM
     ([VarBndr TcId Specificity],
      ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-393"></span><span>              </span><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcRn]
-&gt; TcM ([Kind], [Kind], Kind)
-&gt; TcM ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))
forall flag a.
OutputableBndrFlag flag =&gt;
[LHsTyVarBndr flag GhcRn] -&gt; TcM a -&gt; TcM ([VarBndr TcId flag], a)
</span><a href="GHC.Tc.Gen.HsType.html#bindExplicitTKBndrs_Skol"><span class="hs-identifier hs-var">bindExplicitTKBndrs_Skol</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsTyVarBndr Specificity GhcRn]
</span><a href="#local-6989586621681117818"><span class="hs-identifier hs-var">ex_hs_tvbndrs</span></a></span><span>   </span><span class="annot"><span class="annottext">(TcM ([Kind], [Kind], Kind)
 -&gt; TcM ([VarBndr TcId Specificity], ([Kind], [Kind], Kind)))
-&gt; TcM ([Kind], [Kind], Kind)
-&gt; TcM ([VarBndr TcId Specificity], ([Kind], [Kind], Kind))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-394"></span><span>              </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681117805"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117805"><span class="hs-identifier hs-var">req</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan [GenLocated SrcSpan (HsType GhcRn)]
-&gt; TcM [Kind]
</span><a href="GHC.Tc.Gen.HsType.html#tcHsContext"><span class="hs-identifier hs-var">tcHsContext</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan [GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117821"><span class="hs-identifier hs-var">hs_req</span></a></span><span>
</span><span id="line-395"></span><span>                 </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117803"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117803"><span class="hs-identifier hs-var">prov</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan [GenLocated SrcSpan (HsType GhcRn)]
-&gt; TcM [Kind]
</span><a href="GHC.Tc.Gen.HsType.html#tcHsContext"><span class="hs-identifier hs-var">tcHsContext</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan [GenLocated SrcSpan (HsType GhcRn)]
</span><a href="#local-6989586621681117817"><span class="hs-identifier hs-var">hs_prov</span></a></span><span>
</span><span id="line-396"></span><span>                 </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117802"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117802"><span class="hs-identifier hs-var">body_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn) -&gt; TcM Kind
</span><a href="GHC.Tc.Gen.HsType.html#tcHsOpenType"><span class="hs-identifier hs-var">tcHsOpenType</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsType GhcRn)
</span><a href="#local-6989586621681117816"><span class="hs-identifier hs-var">hs_body_ty</span></a></span><span>
</span><span id="line-397"></span><span>                     </span><span class="hs-comment">-- A (literal) pattern can be unlifted;</span><span>
</span><span id="line-398"></span><span>                     </span><span class="hs-comment">-- e.g. pattern Zero &lt;- 0#   (#12094)</span><span>
</span><span id="line-399"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Kind], [Kind], Kind) -&gt; TcM ([Kind], [Kind], Kind)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117805"><span class="hs-identifier hs-var">req</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117803"><span class="hs-identifier hs-var">prov</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117802"><span class="hs-identifier hs-var">body_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681117800"><span class="annot"><span class="annottext">ungen_patsyn_ty :: Kind
</span><a href="#local-6989586621681117800"><span class="hs-identifier hs-var hs-var">ungen_patsyn_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcId]
-&gt; [TcId]
-&gt; [VarBndr TcId Specificity]
-&gt; [Kind]
-&gt; [VarBndr TcId Specificity]
-&gt; [Kind]
-&gt; Kind
-&gt; Kind
</span><a href="#local-6989586621681117799"><span class="hs-identifier hs-var">build_patsyn_type</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117815"><span class="hs-identifier hs-var">implicit_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117814"><span class="hs-identifier hs-var">univ_tvbndrs</span></a></span><span>
</span><span id="line-402"></span><span>                                                 </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117812"><span class="hs-identifier hs-var">req</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117813"><span class="hs-identifier hs-var">ex_tvbndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117811"><span class="hs-identifier hs-var">prov</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117810"><span class="hs-identifier hs-var">body_ty</span></a></span><span>
</span><span id="line-403"></span><span>
</span><span id="line-404"></span><span>       </span><span class="hs-comment">-- Kind generalisation</span><span>
</span><span id="line-405"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117798"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117798"><span class="hs-identifier hs-var">kvs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; TcM [TcId]
</span><a href="GHC.Tc.Gen.HsType.html#kindGeneralizeAll"><span class="hs-identifier hs-var">kindGeneralizeAll</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117800"><span class="hs-identifier hs-var">ungen_patsyn_ty</span></a></span><span>
</span><span id="line-406"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcPatSynSig&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117800"><span class="hs-identifier hs-var">ungen_patsyn_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span>       </span><span class="hs-comment">-- These are /signatures/ so we zonk to squeeze out any kind</span><span>
</span><span id="line-409"></span><span>       </span><span class="hs-comment">-- unification variables.  Do this after kindGeneralize which may</span><span>
</span><span id="line-410"></span><span>       </span><span class="hs-comment">-- default kind variables to *.</span><span>
</span><span id="line-411"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117796"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117796"><span class="hs-identifier hs-var">implicit_tvs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; TcM [TcId]
</span><a href="GHC.Tc.Gen.HsType.html#zonkAndScopedSort"><span class="hs-identifier hs-var">zonkAndScopedSort</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117815"><span class="hs-identifier hs-var">implicit_tvs</span></a></span><span>
</span><span id="line-412"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117794"><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117794"><span class="hs-identifier hs-var">univ_tvbndrs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(VarBndr TcId Specificity
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (VarBndr TcId Specificity))
-&gt; [VarBndr TcId Specificity]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [VarBndr TcId Specificity]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">VarBndr TcId Specificity
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (VarBndr TcId Specificity)
forall fl. VarBndr TcId fl -&gt; TcM (VarBndr TcId fl)
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTyCoVarKindBinder"><span class="hs-identifier hs-var">zonkTyCoVarKindBinder</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117814"><span class="hs-identifier hs-var">univ_tvbndrs</span></a></span><span>
</span><span id="line-413"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117791"><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117791"><span class="hs-identifier hs-var">ex_tvbndrs</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(VarBndr TcId Specificity
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (VarBndr TcId Specificity))
-&gt; [VarBndr TcId Specificity]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [VarBndr TcId Specificity]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">VarBndr TcId Specificity
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (VarBndr TcId Specificity)
forall fl. VarBndr TcId fl -&gt; TcM (VarBndr TcId fl)
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTyCoVarKindBinder"><span class="hs-identifier hs-var">zonkTyCoVarKindBinder</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117813"><span class="hs-identifier hs-var">ex_tvbndrs</span></a></span><span>
</span><span id="line-414"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117790"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117790"><span class="hs-identifier hs-var">req</span></a></span></span><span>          </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; TcM [Kind]
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTcTypes"><span class="hs-identifier hs-var">zonkTcTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117812"><span class="hs-identifier hs-var">req</span></a></span><span>
</span><span id="line-415"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117788"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117788"><span class="hs-identifier hs-var">prov</span></a></span></span><span>         </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; TcM [Kind]
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTcTypes"><span class="hs-identifier hs-var">zonkTcTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117811"><span class="hs-identifier hs-var">prov</span></a></span><span>
</span><span id="line-416"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117787"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117787"><span class="hs-identifier hs-var">body_ty</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; TcM Kind
</span><a href="GHC.Tc.Utils.TcMType.html#zonkTcType"><span class="hs-identifier hs-var">zonkTcType</span></a></span><span>  </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117810"><span class="hs-identifier hs-var">body_ty</span></a></span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span>       </span><span class="hs-comment">-- Skolems have TcLevels too, though they're used only for debugging.</span><span>
</span><span id="line-419"></span><span>       </span><span class="hs-comment">-- If you don't do this, the debugging checks fail in GHC.Tc.TyCl.PatSyn.</span><span>
</span><span id="line-420"></span><span>       </span><span class="hs-comment">-- Test case: patsyn/should_compile/T13441</span><span>
</span><span id="line-421"></span><span class="hs-comment">{-
       ; tclvl &lt;- getTcLevel
       ; let env0                  = mkEmptyTCvSubst $ mkInScopeSet $ mkVarSet kvs
             (env1, implicit_tvs') = promoteSkolemsX tclvl env0 implicit_tvs
             (env2, univ_tvs')     = promoteSkolemsX tclvl env1 univ_tvs
             (env3, ex_tvs')       = promoteSkolemsX tclvl env2 ex_tvs
             req'                  = substTys env3 req
             prov'                 = substTys env3 prov
             body_ty'              = substTy  env3 body_ty
-}</span><span>
</span><span id="line-431"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681117785"><span class="annot"><span class="annottext">implicit_tvs' :: [TcId]
</span><a href="#local-6989586621681117785"><span class="hs-identifier hs-var hs-var">implicit_tvs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117796"><span class="hs-identifier hs-var">implicit_tvs</span></a></span><span>
</span><span id="line-432"></span><span>            </span><span id="local-6989586621681117784"><span class="annot"><span class="annottext">univ_tvbndrs' :: [VarBndr TcId Specificity]
</span><a href="#local-6989586621681117784"><span class="hs-identifier hs-var hs-var">univ_tvbndrs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117794"><span class="hs-identifier hs-var">univ_tvbndrs</span></a></span><span>
</span><span id="line-433"></span><span>            </span><span id="local-6989586621681117783"><span class="annot"><span class="annottext">ex_tvbndrs' :: [VarBndr TcId Specificity]
</span><a href="#local-6989586621681117783"><span class="hs-identifier hs-var hs-var">ex_tvbndrs'</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117791"><span class="hs-identifier hs-var">ex_tvbndrs</span></a></span><span>
</span><span id="line-434"></span><span>            </span><span id="local-6989586621681117782"><span class="annot"><span class="annottext">req' :: [Kind]
</span><a href="#local-6989586621681117782"><span class="hs-identifier hs-var hs-var">req'</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117790"><span class="hs-identifier hs-var">req</span></a></span><span>
</span><span id="line-435"></span><span>            </span><span id="local-6989586621681117781"><span class="annot"><span class="annottext">prov' :: [Kind]
</span><a href="#local-6989586621681117781"><span class="hs-identifier hs-var hs-var">prov'</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117788"><span class="hs-identifier hs-var">prov</span></a></span><span>
</span><span id="line-436"></span><span>            </span><span id="local-6989586621681117780"><span class="annot"><span class="annottext">body_ty' :: Kind
</span><a href="#local-6989586621681117780"><span class="hs-identifier hs-var hs-var">body_ty'</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117787"><span class="hs-identifier hs-var">body_ty</span></a></span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span>       </span><span class="hs-comment">-- Now do validity checking</span><span>
</span><span id="line-439"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; Kind -&gt; TcRn ()
</span><a href="GHC.Tc.Validity.html#checkValidType"><span class="hs-identifier hs-var">checkValidType</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117779"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; TcRn ()) -&gt; Kind -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-440"></span><span>         </span><span class="annot"><span class="annottext">[TcId]
-&gt; [TcId]
-&gt; [VarBndr TcId Specificity]
-&gt; [Kind]
-&gt; [VarBndr TcId Specificity]
-&gt; [Kind]
-&gt; Kind
-&gt; Kind
</span><a href="#local-6989586621681117799"><span class="hs-identifier hs-var">build_patsyn_type</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117798"><span class="hs-identifier hs-var">kvs</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117785"><span class="hs-identifier hs-var">implicit_tvs'</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117784"><span class="hs-identifier hs-var">univ_tvbndrs'</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117782"><span class="hs-identifier hs-var">req'</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117783"><span class="hs-identifier hs-var">ex_tvbndrs'</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117781"><span class="hs-identifier hs-var">prov'</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117780"><span class="hs-identifier hs-var">body_ty'</span></a></span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span>       </span><span class="hs-comment">-- arguments become the types of binders. We thus cannot allow</span><span>
</span><span id="line-443"></span><span>       </span><span class="hs-comment">-- levity polymorphism here</span><span>
</span><span id="line-444"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117778"><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621681117778"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; ([Scaled Kind], Kind)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitFunTys"><span class="hs-identifier hs-var">tcSplitFunTys</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117780"><span class="hs-identifier hs-var">body_ty'</span></a></span><span>
</span><span id="line-445"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Scaled Kind -&gt; TcRn ()) -&gt; [Scaled Kind] -&gt; TcRn ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Kind -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.TcMType.html#checkForLevPoly"><span class="hs-identifier hs-var">checkForLevPoly</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; TcRn ())
-&gt; (Scaled Kind -&gt; Kind) -&gt; Scaled Kind -&gt; TcRn ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled Kind -&gt; Kind
forall a. Scaled a -&gt; a
</span><a href="GHC.Core.TyCo.Rep.html#scaledThing"><span class="hs-identifier hs-var">scaledThing</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621681117778"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-446"></span><span>
</span><span id="line-447"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcTySig }&quot;</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; TcRn ()) -&gt; SDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-448"></span><span>         </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;implicit_tvs&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; SDoc
</span><a href="GHC.Tc.Gen.Sig.html#ppr_tvs"><span class="hs-identifier hs-var">ppr_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117785"><span class="hs-identifier hs-var">implicit_tvs'</span></a></span><span>
</span><span id="line-449"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;kvs&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; SDoc
</span><a href="GHC.Tc.Gen.Sig.html#ppr_tvs"><span class="hs-identifier hs-var">ppr_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117798"><span class="hs-identifier hs-var">kvs</span></a></span><span>
</span><span id="line-450"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;univ_tvs&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; SDoc
</span><a href="GHC.Tc.Gen.Sig.html#ppr_tvs"><span class="hs-identifier hs-var">ppr_tvs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr TcId Specificity] -&gt; [TcId]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117784"><span class="hs-identifier hs-var">univ_tvbndrs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-451"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;req&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117782"><span class="hs-identifier hs-var">req'</span></a></span><span>
</span><span id="line-452"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ex_tvs&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; SDoc
</span><a href="GHC.Tc.Gen.Sig.html#ppr_tvs"><span class="hs-identifier hs-var">ppr_tvs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr TcId Specificity] -&gt; [TcId]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117783"><span class="hs-identifier hs-var">ex_tvbndrs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-453"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;prov&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117781"><span class="hs-identifier hs-var">prov'</span></a></span><span>
</span><span id="line-454"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;body_ty&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117780"><span class="hs-identifier hs-var">body_ty'</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-455"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcPatSynInfo -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcPatSynInfo
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TPSI :: Name
-&gt; [VarBndr TcId Specificity]
-&gt; [VarBndr TcId Specificity]
-&gt; [Kind]
-&gt; [VarBndr TcId Specificity]
-&gt; [Kind]
-&gt; Kind
-&gt; TcPatSynInfo
</span><a href="GHC.Tc.Types.html#TPSI"><span class="hs-identifier hs-type">TPSI</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">patsig_name :: Name
</span><a href="GHC.Tc.Types.html#patsig_name"><span class="hs-identifier hs-var">patsig_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117827"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-456"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_implicit_bndrs :: [VarBndr TcId Specificity]
</span><a href="GHC.Tc.Types.html#patsig_implicit_bndrs"><span class="hs-identifier hs-var">patsig_implicit_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Specificity -&gt; [TcId] -&gt; [VarBndr TcId Specificity]
forall vis. vis -&gt; [TcId] -&gt; [VarBndr TcId vis]
</span><a href="GHC.Types.Var.html#mkTyVarBinders"><span class="hs-identifier hs-var">mkTyVarBinders</span></a></span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#InferredSpec"><span class="hs-identifier hs-var">InferredSpec</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117798"><span class="hs-identifier hs-var">kvs</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
-&gt; [VarBndr TcId Specificity] -&gt; [VarBndr TcId Specificity]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-457"></span><span>                                                </span><span class="annot"><span class="annottext">Specificity -&gt; [TcId] -&gt; [VarBndr TcId Specificity]
forall vis. vis -&gt; [TcId] -&gt; [VarBndr TcId vis]
</span><a href="GHC.Types.Var.html#mkTyVarBinders"><span class="hs-identifier hs-var">mkTyVarBinders</span></a></span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#SpecifiedSpec"><span class="hs-identifier hs-var">SpecifiedSpec</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117785"><span class="hs-identifier hs-var">implicit_tvs'</span></a></span><span>
</span><span id="line-458"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_univ_bndrs :: [VarBndr TcId Specificity]
</span><a href="GHC.Tc.Types.html#patsig_univ_bndrs"><span class="hs-identifier hs-var">patsig_univ_bndrs</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117784"><span class="hs-identifier hs-var">univ_tvbndrs'</span></a></span><span>
</span><span id="line-459"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_req :: [Kind]
</span><a href="GHC.Tc.Types.html#patsig_req"><span class="hs-identifier hs-var">patsig_req</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117782"><span class="hs-identifier hs-var">req'</span></a></span><span>
</span><span id="line-460"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_ex_bndrs :: [VarBndr TcId Specificity]
</span><a href="GHC.Tc.Types.html#patsig_ex_bndrs"><span class="hs-identifier hs-var">patsig_ex_bndrs</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117783"><span class="hs-identifier hs-var">ex_tvbndrs'</span></a></span><span>
</span><span id="line-461"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_prov :: [Kind]
</span><a href="GHC.Tc.Types.html#patsig_prov"><span class="hs-identifier hs-var">patsig_prov</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117781"><span class="hs-identifier hs-var">prov'</span></a></span><span>
</span><span id="line-462"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_body_ty :: Kind
</span><a href="GHC.Tc.Types.html#patsig_body_ty"><span class="hs-identifier hs-var">patsig_body_ty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117780"><span class="hs-identifier hs-var">body_ty'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-463"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-464"></span><span>    </span><span id="local-6989586621681117779"><span class="annot"><span class="annottext">ctxt :: UserTypeCtxt
</span><a href="#local-6989586621681117779"><span class="hs-identifier hs-var hs-var">ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#PatSynCtxt"><span class="hs-identifier hs-var">PatSynCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117827"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-465"></span><span>
</span><span id="line-466"></span><span>    </span><span id="local-6989586621681117799"><span class="annot"><span class="annottext">build_patsyn_type :: [TcId]
-&gt; [TcId]
-&gt; [VarBndr TcId Specificity]
-&gt; [Kind]
-&gt; [VarBndr TcId Specificity]
-&gt; [Kind]
-&gt; Kind
-&gt; Kind
</span><a href="#local-6989586621681117799"><span class="hs-identifier hs-var hs-var">build_patsyn_type</span></a></span></span><span> </span><span id="local-6989586621681117758"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117758"><span class="hs-identifier hs-var">kvs</span></a></span></span><span> </span><span id="local-6989586621681117757"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117757"><span class="hs-identifier hs-var">imp</span></a></span></span><span> </span><span id="local-6989586621681117756"><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117756"><span class="hs-identifier hs-var">univ_bndrs</span></a></span></span><span> </span><span id="local-6989586621681117755"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117755"><span class="hs-identifier hs-var">req</span></a></span></span><span> </span><span id="local-6989586621681117754"><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117754"><span class="hs-identifier hs-var">ex_bndrs</span></a></span></span><span> </span><span id="local-6989586621681117753"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117753"><span class="hs-identifier hs-var">prov</span></a></span></span><span> </span><span id="local-6989586621681117752"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117752"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-467"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcId] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#mkInfForAllTys"><span class="hs-identifier hs-var">mkInfForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117758"><span class="hs-identifier hs-var">kvs</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-468"></span><span>        </span><span class="annot"><span class="annottext">[TcId] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#mkSpecForAllTys"><span class="hs-identifier hs-var">mkSpecForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117757"><span class="hs-identifier hs-var">imp</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-469"></span><span>        </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkInvisForAllTys"><span class="hs-identifier hs-var">mkInvisForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117756"><span class="hs-identifier hs-var">univ_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-470"></span><span>        </span><span class="annot"><span class="annottext">[Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#mkPhiTy"><span class="hs-identifier hs-var">mkPhiTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117755"><span class="hs-identifier hs-var">req</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-471"></span><span>        </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkInvisForAllTys"><span class="hs-identifier hs-var">mkInvisForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr TcId Specificity]
</span><a href="#local-6989586621681117754"><span class="hs-identifier hs-var">ex_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-472"></span><span>        </span><span class="annot"><span class="annottext">[Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#mkPhiTy"><span class="hs-identifier hs-var">mkPhiTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117753"><span class="hs-identifier hs-var">prov</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-473"></span><span>        </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117752"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-474"></span><span>
</span><span id="line-475"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#ppr_tvs"><span class="hs-identifier hs-type">ppr_tvs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-476"></span><span id="ppr_tvs"><span class="annot"><span class="annottext">ppr_tvs :: [TcId] -&gt; SDoc
</span><a href="GHC.Tc.Gen.Sig.html#ppr_tvs"><span class="hs-identifier hs-var hs-var">ppr_tvs</span></a></span></span><span> </span><span id="local-6989586621681117747"><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117747"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117745"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dcolon"><span class="hs-identifier hs-var">dcolon</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; Kind
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117745"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-477"></span><span>                           </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681117745"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117745"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcId]
</span><a href="#local-6989586621681117747"><span class="hs-identifier hs-var">tvs</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-478"></span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
               Instantiating user signatures
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-485"></span><span>
</span><span id="line-486"></span><span>
</span><span id="line-487"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcInstSig"><span class="hs-identifier hs-type">tcInstSig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSigInfo"><span class="hs-identifier hs-type">TcIdSigInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcIdSigInst"><span class="hs-identifier hs-type">TcIdSigInst</span></a></span><span>
</span><span id="line-488"></span><span class="hs-comment">-- Instantiate a type signature; only used with plan InferGen</span><span>
</span><span id="line-489"></span><span id="tcInstSig"><span class="annot"><span class="annottext">tcInstSig :: TcIdSigInfo -&gt; TcM TcIdSigInst
</span><a href="GHC.Tc.Gen.Sig.html#tcInstSig"><span class="hs-identifier hs-var hs-var">tcInstSig</span></a></span></span><span> </span><span id="local-6989586621681117743"><span class="annot"><span class="annottext">sig :: TcIdSigInfo
</span><a href="#local-6989586621681117743"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#CompleteSig"><span class="hs-identifier hs-type">CompleteSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sig_bndr :: TcIdSigInfo -&gt; TcId
</span><a href="GHC.Tc.Types.html#sig_bndr"><span class="hs-identifier hs-var">sig_bndr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117742"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117742"><span class="hs-identifier hs-var">poly_id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_loc :: TcIdSigInfo -&gt; SrcSpan
</span><a href="GHC.Tc.Types.html#sig_loc"><span class="hs-identifier hs-var">sig_loc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117741"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117741"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-490"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM TcIdSigInst -&gt; TcM TcIdSigInst
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117741"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM TcIdSigInst -&gt; TcM TcIdSigInst)
-&gt; TcM TcIdSigInst -&gt; TcM TcIdSigInst
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>  </span><span class="hs-comment">-- Set the binding site of the tyvars</span><span>
</span><span id="line-491"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117740"><span class="annot"><span class="annottext">[(Name, VarBndr TcId Specificity)]
</span><a href="#local-6989586621681117740"><span class="hs-identifier hs-var">tv_prs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117739"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117739"><span class="hs-identifier hs-var">theta</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117738"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117738"><span class="hs-identifier hs-var">tau</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; TcM ([(Name, VarBndr TcId Specificity)], [Kind], Kind)
</span><a href="GHC.Tc.Utils.Instantiate.html#tcInstTypeBndrs"><span class="hs-identifier hs-var">tcInstTypeBndrs</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117742"><span class="hs-identifier hs-var">poly_id</span></a></span><span>
</span><span id="line-492"></span><span>              </span><span class="hs-comment">-- See Note [Pattern bindings and complete signatures]</span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcIdSigInst -&gt; TcM TcIdSigInst
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TISI :: TcIdSigInfo
-&gt; [(Name, VarBndr TcId Specificity)]
-&gt; [Kind]
-&gt; Kind
-&gt; [(Name, TcId)]
-&gt; Maybe Kind
-&gt; TcIdSigInst
</span><a href="GHC.Tc.Types.html#TISI"><span class="hs-identifier hs-type">TISI</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sig_inst_sig :: TcIdSigInfo
</span><a href="GHC.Tc.Types.html#sig_inst_sig"><span class="hs-identifier hs-var">sig_inst_sig</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681117743"><span class="hs-identifier hs-var">sig</span></a></span><span>
</span><span id="line-495"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_skols :: [(Name, VarBndr TcId Specificity)]
</span><a href="GHC.Tc.Types.html#sig_inst_skols"><span class="hs-identifier hs-var">sig_inst_skols</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, VarBndr TcId Specificity)]
</span><a href="#local-6989586621681117740"><span class="hs-identifier hs-var">tv_prs</span></a></span><span>
</span><span id="line-496"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_wcs :: [(Name, TcId)]
</span><a href="GHC.Tc.Types.html#sig_inst_wcs"><span class="hs-identifier hs-var">sig_inst_wcs</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-497"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_wcx :: Maybe Kind
</span><a href="GHC.Tc.Types.html#sig_inst_wcx"><span class="hs-identifier hs-var">sig_inst_wcx</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Kind
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-498"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_theta :: [Kind]
</span><a href="GHC.Tc.Types.html#sig_inst_theta"><span class="hs-identifier hs-var">sig_inst_theta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117739"><span class="hs-identifier hs-var">theta</span></a></span><span>
</span><span id="line-499"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_tau :: Kind
</span><a href="GHC.Tc.Types.html#sig_inst_tau"><span class="hs-identifier hs-var">sig_inst_tau</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117738"><span class="hs-identifier hs-var">tau</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-500"></span><span>
</span><span id="line-501"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcInstSig"><span class="hs-identifier hs-var">tcInstSig</span></a></span><span> </span><span id="local-6989586621681117730"><span class="annot"><span class="annottext">hs_sig :: TcIdSigInfo
</span><a href="#local-6989586621681117730"><span class="hs-identifier hs-var">hs_sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#PartialSig"><span class="hs-identifier hs-type">PartialSig</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psig_hs_ty :: TcIdSigInfo -&gt; LHsSigWcType GhcRn
</span><a href="GHC.Tc.Types.html#psig_hs_ty"><span class="hs-identifier hs-var">psig_hs_ty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117729"><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681117729"><span class="hs-identifier hs-var">hs_ty</span></a></span></span><span>
</span><span id="line-502"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_ctxt :: TcIdSigInfo -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.html#sig_ctxt"><span class="hs-identifier hs-var">sig_ctxt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117728"><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117728"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span>
</span><span id="line-503"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_loc :: TcIdSigInfo -&gt; SrcSpan
</span><a href="GHC.Tc.Types.html#sig_loc"><span class="hs-identifier hs-var">sig_loc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117727"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117727"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-504"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM TcIdSigInst -&gt; TcM TcIdSigInst
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117727"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM TcIdSigInst -&gt; TcM TcIdSigInst)
-&gt; TcM TcIdSigInst -&gt; TcM TcIdSigInst
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>  </span><span class="hs-comment">-- Set the binding site of the tyvars</span><span>
</span><span id="line-505"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Staring partial sig {&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcIdSigInfo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681117730"><span class="hs-identifier hs-var">hs_sig</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-506"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117726"><span class="annot"><span class="annottext">[(Name, TcId)]
</span><a href="#local-6989586621681117726"><span class="hs-identifier hs-var">wcs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117725"><span class="annot"><span class="annottext">Maybe Kind
</span><a href="#local-6989586621681117725"><span class="hs-identifier hs-var">wcx</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117724"><span class="annot"><span class="annottext">[(Name, VarBndr TcId Specificity)]
</span><a href="#local-6989586621681117724"><span class="hs-identifier hs-var">tv_prs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117723"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117723"><span class="hs-identifier hs-var">theta</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117722"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117722"><span class="hs-identifier hs-var">tau</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
-&gt; LHsSigWcType GhcRn
-&gt; TcM
     ([(Name, TcId)], Maybe Kind, [(Name, VarBndr TcId Specificity)],
      [Kind], Kind)
</span><a href="GHC.Tc.Gen.HsType.html#tcHsPartialSigType"><span class="hs-identifier hs-var">tcHsPartialSigType</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117728"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681117729"><span class="hs-identifier hs-var">hs_ty</span></a></span><span>
</span><span id="line-507"></span><span>         </span><span class="hs-comment">-- See Note [Checking partial type signatures] in GHC.Tc.Gen.HsType</span><span>
</span><span id="line-508"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681117720"><span class="annot"><span class="annottext">inst_sig :: TcIdSigInst
</span><a href="#local-6989586621681117720"><span class="hs-identifier hs-var hs-var">inst_sig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TISI :: TcIdSigInfo
-&gt; [(Name, VarBndr TcId Specificity)]
-&gt; [Kind]
-&gt; Kind
-&gt; [(Name, TcId)]
-&gt; Maybe Kind
-&gt; TcIdSigInst
</span><a href="GHC.Tc.Types.html#TISI"><span class="hs-identifier hs-type">TISI</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sig_inst_sig :: TcIdSigInfo
</span><a href="GHC.Tc.Types.html#sig_inst_sig"><span class="hs-identifier hs-var">sig_inst_sig</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681117730"><span class="hs-identifier hs-var">hs_sig</span></a></span><span>
</span><span id="line-509"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_skols :: [(Name, VarBndr TcId Specificity)]
</span><a href="GHC.Tc.Types.html#sig_inst_skols"><span class="hs-identifier hs-var">sig_inst_skols</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, VarBndr TcId Specificity)]
</span><a href="#local-6989586621681117724"><span class="hs-identifier hs-var">tv_prs</span></a></span><span>
</span><span id="line-510"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_wcs :: [(Name, TcId)]
</span><a href="GHC.Tc.Types.html#sig_inst_wcs"><span class="hs-identifier hs-var">sig_inst_wcs</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, TcId)]
</span><a href="#local-6989586621681117726"><span class="hs-identifier hs-var">wcs</span></a></span><span>
</span><span id="line-511"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_wcx :: Maybe Kind
</span><a href="GHC.Tc.Types.html#sig_inst_wcx"><span class="hs-identifier hs-var">sig_inst_wcx</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Kind
</span><a href="#local-6989586621681117725"><span class="hs-identifier hs-var">wcx</span></a></span><span>
</span><span id="line-512"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_theta :: [Kind]
</span><a href="GHC.Tc.Types.html#sig_inst_theta"><span class="hs-identifier hs-var">sig_inst_theta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681117723"><span class="hs-identifier hs-var">theta</span></a></span><span>
</span><span id="line-513"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sig_inst_tau :: Kind
</span><a href="GHC.Tc.Types.html#sig_inst_tau"><span class="hs-identifier hs-var">sig_inst_tau</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117722"><span class="hs-identifier hs-var">tau</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-514"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;End partial sig }&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcIdSigInst -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcIdSigInst
</span><a href="#local-6989586621681117720"><span class="hs-identifier hs-var">inst_sig</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-515"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcIdSigInst -&gt; TcM TcIdSigInst
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcIdSigInst
</span><a href="#local-6989586621681117720"><span class="hs-identifier hs-var">inst_sig</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-516"></span><span>
</span><span id="line-517"></span><span>
</span><span id="line-518"></span><span class="hs-comment">{- Note [Pattern bindings and complete signatures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
      data T a = MkT a a
      f :: forall a. a-&gt;a
      g :: forall b. b-&gt;b
      MkT f g = MkT (\x-&gt;x) (\y-&gt;y)
Here we'll infer a type from the pattern of 'T a', but if we feed in
the signature types for f and g, we'll end up unifying 'a' and 'b'

So we instantiate f and g's signature with TyVarTv skolems
(newMetaTyVarTyVars) that can unify with each other.  If too much
unification takes place, we'll find out when we do the final
impedance-matching check in GHC.Tc.Gen.Bind.mkExport

See Note [Signature skolems] in GHC.Tc.Utils.TcType

None of this applies to a function binding with a complete
signature, which doesn't use tcInstSig.  See GHC.Tc.Gen.Bind.tcPolyCheck.
-}</span><span>
</span><span id="line-538"></span><span>
</span><span id="line-539"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                   Pragmas and PragEnv
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-544"></span><span>
</span><span id="line-545"></span><span class="hs-keyword">type</span><span> </span><span id="TcPragEnv"><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier hs-var">TcPragEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-546"></span><span>
</span><span id="line-547"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#emptyPragEnv"><span class="hs-identifier hs-type">emptyPragEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier hs-type">TcPragEnv</span></a></span><span>
</span><span id="line-548"></span><span id="emptyPragEnv"><span class="annot"><span class="annottext">emptyPragEnv :: TcPragEnv
</span><a href="GHC.Tc.Gen.Sig.html#emptyPragEnv"><span class="hs-identifier hs-var hs-var">emptyPragEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcPragEnv
forall a. NameEnv a
</span><a href="GHC.Types.Name.Env.html#emptyNameEnv"><span class="hs-identifier hs-var">emptyNameEnv</span></a></span><span>
</span><span id="line-549"></span><span>
</span><span id="line-550"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#lookupPragEnv"><span class="hs-identifier hs-type">lookupPragEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier hs-type">TcPragEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-551"></span><span id="lookupPragEnv"><span class="annot"><span class="annottext">lookupPragEnv :: TcPragEnv -&gt; Name -&gt; [LSig GhcRn]
</span><a href="GHC.Tc.Gen.Sig.html#lookupPragEnv"><span class="hs-identifier hs-var hs-var">lookupPragEnv</span></a></span></span><span> </span><span id="local-6989586621681117718"><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681117718"><span class="hs-identifier hs-var">prag_fn</span></a></span></span><span> </span><span id="local-6989586621681117717"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117717"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcPragEnv -&gt; Name -&gt; Maybe [LSig GhcRn]
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681117718"><span class="hs-identifier hs-var">prag_fn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117717"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [LSig GhcRn] -&gt; [LSig GhcRn] -&gt; [LSig GhcRn]
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#extendPragEnv"><span class="hs-identifier hs-type">extendPragEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier hs-type">TcPragEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier hs-type">TcPragEnv</span></a></span><span>
</span><span id="line-554"></span><span id="extendPragEnv"><span class="annot"><span class="annottext">extendPragEnv :: TcPragEnv -&gt; (Name, LSig GhcRn) -&gt; TcPragEnv
</span><a href="GHC.Tc.Gen.Sig.html#extendPragEnv"><span class="hs-identifier hs-var hs-var">extendPragEnv</span></a></span></span><span> </span><span id="local-6989586621681117716"><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681117716"><span class="hs-identifier hs-var">prag_fn</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117715"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117715"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117714"><span class="annot"><span class="annottext">LSig GhcRn
</span><a href="#local-6989586621681117714"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; [LSig GhcRn] -&gt; [LSig GhcRn])
-&gt; (LSig GhcRn -&gt; [LSig GhcRn])
-&gt; TcPragEnv
-&gt; Name
-&gt; LSig GhcRn
-&gt; TcPragEnv
forall a b.
(a -&gt; b -&gt; b) -&gt; (a -&gt; b) -&gt; NameEnv b -&gt; Name -&gt; a -&gt; NameEnv b
</span><a href="GHC.Types.Name.Env.html#extendNameEnv_Acc"><span class="hs-identifier hs-var">extendNameEnv_Acc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LSig GhcRn -&gt; [LSig GhcRn]
forall a. a -&gt; [a]
</span><a href="GHC.Utils.Misc.html#singleton"><span class="hs-identifier hs-var">Utils.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="#local-6989586621681117716"><span class="hs-identifier hs-var">prag_fn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117715"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn
</span><a href="#local-6989586621681117714"><span class="hs-identifier hs-var">sig</span></a></span><span>
</span><span id="line-555"></span><span>
</span><span id="line-556"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-557"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#mkPragEnv"><span class="hs-identifier hs-type">mkPragEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#TcPragEnv"><span class="hs-identifier hs-type">TcPragEnv</span></a></span><span>
</span><span id="line-558"></span><span id="mkPragEnv"><span class="annot"><span class="annottext">mkPragEnv :: [LSig GhcRn] -&gt; LHsBinds GhcRn -&gt; TcPragEnv
</span><a href="GHC.Tc.Gen.Sig.html#mkPragEnv"><span class="hs-identifier hs-var hs-var">mkPragEnv</span></a></span></span><span> </span><span id="local-6989586621681117712"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117712"><span class="hs-identifier hs-var">sigs</span></a></span></span><span> </span><span id="local-6989586621681117711"><span class="annot"><span class="annottext">LHsBinds GhcRn
</span><a href="#local-6989586621681117711"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-559"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TcPragEnv -&gt; (Name, LSig GhcRn) -&gt; TcPragEnv)
-&gt; TcPragEnv -&gt; [(Name, LSig GhcRn)] -&gt; TcPragEnv
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv -&gt; (Name, LSig GhcRn) -&gt; TcPragEnv
</span><a href="GHC.Tc.Gen.Sig.html#extendPragEnv"><span class="hs-identifier hs-var">extendPragEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
forall a. NameEnv a
</span><a href="GHC.Types.Name.Env.html#emptyNameEnv"><span class="hs-identifier hs-var">emptyNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, LSig GhcRn)]
</span><a href="#local-6989586621681117709"><span class="hs-identifier hs-var">prs</span></a></span><span>
</span><span id="line-560"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-561"></span><span>    </span><span id="local-6989586621681117709"><span class="annot"><span class="annottext">prs :: [(Name, LSig GhcRn)]
</span><a href="#local-6989586621681117709"><span class="hs-identifier hs-var hs-var">prs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; Maybe (Name, LSig GhcRn))
-&gt; [LSig GhcRn] -&gt; [(Name, LSig GhcRn)]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn -&gt; Maybe (Name, LSig GhcRn)
</span><a href="#local-6989586621681117708"><span class="hs-identifier hs-var">get_sig</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117712"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-562"></span><span>
</span><span id="line-563"></span><span>    </span><span class="annot"><a href="#local-6989586621681117708"><span class="hs-identifier hs-type">get_sig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-564"></span><span>    </span><span id="local-6989586621681117708"><span class="annot"><span class="annottext">get_sig :: LSig GhcRn -&gt; Maybe (Name, LSig GhcRn)
</span><a href="#local-6989586621681117708"><span class="hs-identifier hs-var hs-var">get_sig</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117707"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117707"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-type">SpecSig</span></a></span><span> </span><span id="local-6989586621681117705"><span class="annot"><span class="annottext">XSpecSig GhcRn
</span><a href="#local-6989586621681117705"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681117704"><span class="annot"><span class="annottext">lnm :: Located (IdP GhcRn)
</span><a href="#local-6989586621681117704"><span class="hs-identifier hs-var">lnm</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117703"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681117703"><span class="hs-identifier hs-var">nm</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681117702"><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><a href="#local-6989586621681117702"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681117701"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117701"><span class="hs-identifier hs-var">inl</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-565"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name, LSig GhcRn) -&gt; Maybe (Name, LSig GhcRn)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681117703"><span class="hs-identifier hs-var">nm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Sig GhcRn -&gt; LSig GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117707"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn -&gt; LSig GhcRn) -&gt; Sig GhcRn -&gt; LSig GhcRn
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XSpecSig GhcRn
-&gt; Located (IdP GhcRn)
-&gt; [LHsSigType GhcRn]
-&gt; InlinePragma
-&gt; Sig GhcRn
forall pass.
XSpecSig pass
-&gt; Located (IdP pass)
-&gt; [LHsSigType pass]
-&gt; InlinePragma
-&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-var">SpecSig</span></a></span><span>   </span><span class="annot"><span class="annottext">XSpecSig GhcRn
</span><a href="#local-6989586621681117705"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><a href="#local-6989586621681117704"><span class="hs-identifier hs-var">lnm</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><a href="#local-6989586621681117702"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; InlinePragma -&gt; InlinePragma
</span><a href="#local-6989586621681117700"><span class="hs-identifier hs-var">add_arity</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681117703"><span class="hs-identifier hs-var">nm</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117701"><span class="hs-identifier hs-var">inl</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-566"></span><span>    </span><span class="annot"><a href="#local-6989586621681117708"><span class="hs-identifier hs-var">get_sig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117699"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117699"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-type">InlineSig</span></a></span><span> </span><span id="local-6989586621681117697"><span class="annot"><span class="annottext">XInlineSig GhcRn
</span><a href="#local-6989586621681117697"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681117696"><span class="annot"><span class="annottext">lnm :: Located (IdP GhcRn)
</span><a href="#local-6989586621681117696"><span class="hs-identifier hs-var">lnm</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117695"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681117695"><span class="hs-identifier hs-var">nm</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681117694"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117694"><span class="hs-identifier hs-var">inl</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-567"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name, LSig GhcRn) -&gt; Maybe (Name, LSig GhcRn)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681117695"><span class="hs-identifier hs-var">nm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Sig GhcRn -&gt; LSig GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117699"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn -&gt; LSig GhcRn) -&gt; Sig GhcRn -&gt; LSig GhcRn
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XInlineSig GhcRn
-&gt; Located (IdP GhcRn) -&gt; InlinePragma -&gt; Sig GhcRn
forall pass.
XInlineSig pass -&gt; Located (IdP pass) -&gt; InlinePragma -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-var">InlineSig</span></a></span><span> </span><span class="annot"><span class="annottext">XInlineSig GhcRn
</span><a href="#local-6989586621681117697"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><a href="#local-6989586621681117696"><span class="hs-identifier hs-var">lnm</span></a></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; InlinePragma -&gt; InlinePragma
</span><a href="#local-6989586621681117700"><span class="hs-identifier hs-var">add_arity</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681117695"><span class="hs-identifier hs-var">nm</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117694"><span class="hs-identifier hs-var">inl</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-568"></span><span>    </span><span class="annot"><a href="#local-6989586621681117708"><span class="hs-identifier hs-var">get_sig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117693"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117693"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-type">SCCFunSig</span></a></span><span> </span><span id="local-6989586621681117691"><span class="annot"><span class="annottext">XSCCFunSig GhcRn
</span><a href="#local-6989586621681117691"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681117690"><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681117690"><span class="hs-identifier hs-var">st</span></a></span></span><span> </span><span id="local-6989586621681117689"><span class="annot"><span class="annottext">lnm :: Located (IdP GhcRn)
</span><a href="#local-6989586621681117689"><span class="hs-identifier hs-var">lnm</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117688"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681117688"><span class="hs-identifier hs-var">nm</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681117687"><span class="annot"><span class="annottext">Maybe (Located StringLiteral)
</span><a href="#local-6989586621681117687"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-569"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name, LSig GhcRn) -&gt; Maybe (Name, LSig GhcRn)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681117688"><span class="hs-identifier hs-var">nm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Sig GhcRn -&gt; LSig GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117693"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn -&gt; LSig GhcRn) -&gt; Sig GhcRn -&gt; LSig GhcRn
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XSCCFunSig GhcRn
-&gt; SourceText
-&gt; Located (IdP GhcRn)
-&gt; Maybe (Located StringLiteral)
-&gt; Sig GhcRn
forall pass.
XSCCFunSig pass
-&gt; SourceText
-&gt; Located (IdP pass)
-&gt; Maybe (Located StringLiteral)
-&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-var">SCCFunSig</span></a></span><span> </span><span class="annot"><span class="annottext">XSCCFunSig GhcRn
</span><a href="#local-6989586621681117691"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681117690"><span class="hs-identifier hs-var">st</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><a href="#local-6989586621681117689"><span class="hs-identifier hs-var">lnm</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Located StringLiteral)
</span><a href="#local-6989586621681117687"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-570"></span><span>    </span><span class="annot"><a href="#local-6989586621681117708"><span class="hs-identifier hs-var">get_sig</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Name, LSig GhcRn)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-571"></span><span>
</span><span id="line-572"></span><span>    </span><span id="local-6989586621681117700"><span class="annot"><span class="annottext">add_arity :: Name -&gt; InlinePragma -&gt; InlinePragma
</span><a href="#local-6989586621681117700"><span class="hs-identifier hs-var hs-var">add_arity</span></a></span></span><span> </span><span id="local-6989586621681117683"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117683"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681117682"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117682"><span class="hs-identifier hs-var">inl_prag</span></a></span></span><span>   </span><span class="hs-comment">-- Adjust inl_sat field to match visible arity of function</span><span>
</span><span id="line-573"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">InlineSpec
</span><a href="GHC.Types.Basic.html#Inline"><span class="hs-identifier hs-var">Inline</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; InlineSpec
</span><a href="GHC.Types.Basic.html#inl_inline"><span class="hs-identifier hs-var hs-var">inl_inline</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117682"><span class="hs-identifier hs-var">inl_prag</span></a></span><span>
</span><span id="line-574"></span><span>        </span><span class="hs-comment">-- add arity only for real INLINE pragmas, not INLINABLE</span><span>
</span><span id="line-575"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">NameEnv Arity -&gt; Name -&gt; Maybe Arity
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Arity
</span><a href="#local-6989586621681117679"><span class="hs-identifier hs-var">ar_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117683"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-576"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681117678"><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681117678"><span class="hs-identifier hs-var">ar</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117682"><span class="hs-identifier hs-var">inl_prag</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">inl_sat :: Maybe Arity
</span><a href="GHC.Types.Basic.html#inl_sat"><span class="hs-identifier hs-var">inl_sat</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; Maybe Arity
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681117678"><span class="hs-identifier hs-var">ar</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-577"></span><span>          </span><span class="annot"><span class="annottext">Maybe Arity
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">WARN</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">True</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">text</span><span> </span><span class="hs-string">&quot;mkPragEnv no arity&quot;</span><span> </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">n</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-578"></span><span>                     </span><span class="hs-comment">-- There really should be a binding for every INLINE pragma</span><span>
</span><span id="line-579"></span><span>                     </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117682"><span class="hs-identifier hs-var">inl_prag</span></a></span><span>
</span><span id="line-580"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-581"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117682"><span class="hs-identifier hs-var">inl_prag</span></a></span><span>
</span><span id="line-582"></span><span>
</span><span id="line-583"></span><span>    </span><span class="hs-comment">-- ar_env maps a local to the arity of its definition</span><span>
</span><span id="line-584"></span><span>    </span><span class="annot"><a href="#local-6989586621681117679"><span class="hs-identifier hs-type">ar_env</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span>
</span><span id="line-585"></span><span>    </span><span id="local-6989586621681117679"><span class="annot"><span class="annottext">ar_env :: NameEnv Arity
</span><a href="#local-6989586621681117679"><span class="hs-identifier hs-var hs-var">ar_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LHsBind GhcRn -&gt; NameEnv Arity -&gt; NameEnv Arity)
-&gt; NameEnv Arity -&gt; LHsBinds GhcRn -&gt; NameEnv Arity
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBind GhcRn -&gt; NameEnv Arity -&gt; NameEnv Arity
</span><a href="GHC.Tc.Gen.Sig.html#lhsBindArity"><span class="hs-identifier hs-var">lhsBindArity</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Arity
forall a. NameEnv a
</span><a href="GHC.Types.Name.Env.html#emptyNameEnv"><span class="hs-identifier hs-var">emptyNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcRn
</span><a href="#local-6989586621681117711"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-586"></span><span>
</span><span id="line-587"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#lhsBindArity"><span class="hs-identifier hs-type">lhsBindArity</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBind"><span class="hs-identifier hs-type">LHsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html#NameEnv"><span class="hs-identifier hs-type">NameEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span>
</span><span id="line-588"></span><span id="lhsBindArity"><span class="annot"><span class="annottext">lhsBindArity :: LHsBind GhcRn -&gt; NameEnv Arity -&gt; NameEnv Arity
</span><a href="GHC.Tc.Gen.Sig.html#lhsBindArity"><span class="hs-identifier hs-var hs-var">lhsBindArity</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: forall idL idR. HsBindLR idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117671"><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><a href="#local-6989586621681117671"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_matches :: forall idL idR. HsBindLR idL idR -&gt; MatchGroup idR (LHsExpr idR)
</span><a href="GHC.Hs.Binds.html#fun_matches"><span class="hs-identifier hs-var">fun_matches</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681117669"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681117669"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681117668"><span class="annot"><span class="annottext">NameEnv Arity
</span><a href="#local-6989586621681117668"><span class="hs-identifier hs-var">env</span></a></span></span><span>
</span><span id="line-589"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameEnv Arity -&gt; Name -&gt; Arity -&gt; NameEnv Arity
forall a. NameEnv a -&gt; Name -&gt; a -&gt; NameEnv a
</span><a href="GHC.Types.Name.Env.html#extendNameEnv"><span class="hs-identifier hs-var">extendNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv Arity
</span><a href="#local-6989586621681117668"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681117671"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn) -&gt; Arity
forall (id :: Pass) body. MatchGroup (GhcPass id) body -&gt; Arity
</span><a href="GHC.Hs.Expr.html#matchGroupArity"><span class="hs-identifier hs-var">matchGroupArity</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681117669"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-590"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#lhsBindArity"><span class="hs-identifier hs-var">lhsBindArity</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBind GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117665"><span class="annot"><span class="annottext">NameEnv Arity
</span><a href="#local-6989586621681117665"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameEnv Arity
</span><a href="#local-6989586621681117665"><span class="hs-identifier hs-var">env</span></a></span><span>        </span><span class="hs-comment">-- PatBind/VarBind</span><span>
</span><span id="line-591"></span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span class="hs-comment">-----------------</span><span>
</span><span id="line-594"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#addInlinePrags"><span class="hs-identifier hs-type">addInlinePrags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span>
</span><span id="line-595"></span><span id="addInlinePrags"><span class="annot"><span class="annottext">addInlinePrags :: TcId -&gt; [LSig GhcRn] -&gt; TcM TcId
</span><a href="GHC.Tc.Gen.Sig.html#addInlinePrags"><span class="hs-identifier hs-var hs-var">addInlinePrags</span></a></span></span><span> </span><span id="local-6989586621681117664"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117664"><span class="hs-identifier hs-var">poly_id</span></a></span></span><span> </span><span id="local-6989586621681117663"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117663"><span class="hs-identifier hs-var">prags_for_me</span></a></span></span><span>
</span><span id="line-596"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681117662"><span class="annot"><span class="annottext">inl :: GenLocated SrcSpan InlinePragma
</span><a href="#local-6989586621681117662"><span class="hs-identifier hs-var">inl</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117661"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117661"><span class="hs-identifier hs-var">prag</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681117660"><span class="annot"><span class="annottext">[GenLocated SrcSpan InlinePragma]
</span><a href="#local-6989586621681117660"><span class="hs-identifier hs-var">inls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan InlinePragma]
</span><a href="#local-6989586621681117659"><span class="hs-identifier hs-var">inl_prags</span></a></span><span>
</span><span id="line-597"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;addInlinePrag&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117664"><span class="hs-identifier hs-var">poly_id</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117661"><span class="hs-identifier hs-var">prag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-598"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[GenLocated SrcSpan InlinePragma] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan InlinePragma]
</span><a href="#local-6989586621681117660"><span class="hs-identifier hs-var">inls</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
-&gt; [GenLocated SrcSpan InlinePragma] -&gt; TcRn ()
</span><a href="#local-6989586621681117657"><span class="hs-identifier hs-var">warn_multiple_inlines</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
</span><a href="#local-6989586621681117662"><span class="hs-identifier hs-var">inl</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan InlinePragma]
</span><a href="#local-6989586621681117660"><span class="hs-identifier hs-var">inls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-599"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; TcM TcId
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117664"><span class="hs-identifier hs-var">poly_id</span></a></span><span> </span><span class="annot"><span class="annottext">TcId -&gt; InlinePragma -&gt; TcId
</span><a href="GHC.Types.Id.html#setInlinePragma"><span class="hs-operator hs-var">`setInlinePragma`</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117661"><span class="hs-identifier hs-var">prag</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-600"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-601"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; TcM TcId
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117664"><span class="hs-identifier hs-var">poly_id</span></a></span><span>
</span><span id="line-602"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-603"></span><span>    </span><span id="local-6989586621681117659"><span class="annot"><span class="annottext">inl_prags :: [GenLocated SrcSpan InlinePragma]
</span><a href="#local-6989586621681117659"><span class="hs-identifier hs-var hs-var">inl_prags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan -&gt; InlinePragma -&gt; GenLocated SrcSpan InlinePragma
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117656"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117655"><span class="hs-identifier hs-var">prag</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117656"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117656"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-type">InlineSig</span></a></span><span> </span><span class="annot"><span class="annottext">XInlineSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117655"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117655"><span class="hs-identifier hs-var">prag</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117663"><span class="hs-identifier hs-var">prags_for_me</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-604"></span><span>
</span><span id="line-605"></span><span>    </span><span id="local-6989586621681117657"><span class="annot"><span class="annottext">warn_multiple_inlines :: GenLocated SrcSpan InlinePragma
-&gt; [GenLocated SrcSpan InlinePragma] -&gt; TcRn ()
</span><a href="#local-6989586621681117657"><span class="hs-identifier hs-var hs-var">warn_multiple_inlines</span></a></span></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-606"></span><span>
</span><span id="line-607"></span><span>    </span><span class="annot"><a href="#local-6989586621681117657"><span class="hs-identifier hs-var">warn_multiple_inlines</span></a></span><span> </span><span id="local-6989586621681117654"><span class="annot"><span class="annottext">inl1 :: GenLocated SrcSpan InlinePragma
</span><a href="#local-6989586621681117654"><span class="hs-identifier hs-var">inl1</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117653"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117653"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681117652"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117652"><span class="hs-identifier hs-var">prag1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117651"><span class="annot"><span class="annottext">inl2 :: GenLocated SrcSpan InlinePragma
</span><a href="#local-6989586621681117651"><span class="hs-identifier hs-var">inl2</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117650"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117650"><span class="hs-identifier hs-var">prag2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681117649"><span class="annot"><span class="annottext">[GenLocated SrcSpan InlinePragma]
</span><a href="#local-6989586621681117649"><span class="hs-identifier hs-var">inls</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-608"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; Activation
</span><a href="GHC.Types.Basic.html#inlinePragmaActivation"><span class="hs-identifier hs-var">inlinePragmaActivation</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117652"><span class="hs-identifier hs-var">prag1</span></a></span><span> </span><span class="annot"><span class="annottext">Activation -&gt; Activation -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; Activation
</span><a href="GHC.Types.Basic.html#inlinePragmaActivation"><span class="hs-identifier hs-var">inlinePragmaActivation</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117650"><span class="hs-identifier hs-var">prag2</span></a></span><span>
</span><span id="line-609"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InlineSpec -&gt; Bool
</span><a href="GHC.Types.Basic.html#noUserInlineSpec"><span class="hs-identifier hs-var">noUserInlineSpec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InlinePragma -&gt; InlineSpec
</span><a href="GHC.Types.Basic.html#inlinePragmaSpec"><span class="hs-identifier hs-var">inlinePragmaSpec</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117652"><span class="hs-identifier hs-var">prag1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-610"></span><span>       </span><span class="hs-glyph">=</span><span>    </span><span class="hs-comment">-- Tiresome: inl1 is put there by virtue of being in a hs-boot loop</span><span>
</span><span id="line-611"></span><span>            </span><span class="hs-comment">-- and inl2 is a user NOINLINE pragma; we don't want to complain</span><span>
</span><span id="line-612"></span><span>         </span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
-&gt; [GenLocated SrcSpan InlinePragma] -&gt; TcRn ()
</span><a href="#local-6989586621681117657"><span class="hs-identifier hs-var">warn_multiple_inlines</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
</span><a href="#local-6989586621681117651"><span class="hs-identifier hs-var">inl2</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan InlinePragma]
</span><a href="#local-6989586621681117649"><span class="hs-identifier hs-var">inls</span></a></span><span>
</span><span id="line-613"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-614"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcRn () -&gt; TcRn ()
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117653"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-615"></span><span>         </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarnTc"><span class="hs-identifier hs-var">addWarnTc</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span>
</span><span id="line-616"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Multiple INLINE pragmas for&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117664"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-617"></span><span>                       </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ignoring all but the first&quot;</span></span><span>
</span><span id="line-618"></span><span>                                </span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan InlinePragma -&gt; SDoc)
-&gt; [GenLocated SrcSpan InlinePragma] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma -&gt; SDoc
forall {a} {a}.
(Outputable a, Outputable a) =&gt;
GenLocated a a -&gt; SDoc
</span><a href="#local-6989586621681117642"><span class="hs-identifier hs-var">pp_inl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
</span><a href="#local-6989586621681117654"><span class="hs-identifier hs-var">inl1</span></a></span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
-&gt; [GenLocated SrcSpan InlinePragma]
-&gt; [GenLocated SrcSpan InlinePragma]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
</span><a href="#local-6989586621681117651"><span class="hs-identifier hs-var">inl2</span></a></span><span class="annot"><span class="annottext">GenLocated SrcSpan InlinePragma
-&gt; [GenLocated SrcSpan InlinePragma]
-&gt; [GenLocated SrcSpan InlinePragma]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[GenLocated SrcSpan InlinePragma]
</span><a href="#local-6989586621681117649"><span class="hs-identifier hs-var">inls</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-619"></span><span>
</span><span id="line-620"></span><span>    </span><span id="local-6989586621681117642"><span class="annot"><span class="annottext">pp_inl :: GenLocated a a -&gt; SDoc
</span><a href="#local-6989586621681117642"><span class="hs-identifier hs-var hs-var">pp_inl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117637"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681117637"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681117636"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681117636"><span class="hs-identifier hs-var">prag</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681117636"><span class="hs-identifier hs-var">prag</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681117637"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-621"></span><span>
</span><span id="line-622"></span><span>
</span><span id="line-623"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                   SPECIALISE pragmas
*                                                                      *
************************************************************************

Note [Handling SPECIALISE pragmas]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The basic idea is this:

   foo :: Num a =&gt; a -&gt; b -&gt; a
   {-# SPECIALISE foo :: Int -&gt; b -&gt; Int #-}

We check that
   (forall a b. Num a =&gt; a -&gt; b -&gt; a)
      is more polymorphic than
   forall b. Int -&gt; b -&gt; Int
(for which we could use tcSubType, but see below), generating a HsWrapper
to connect the two, something like
      wrap = /\b. &lt;hole&gt; Int b dNumInt
This wrapper is put in the TcSpecPrag, in the ABExport record of
the AbsBinds.


        f :: (Eq a, Ix b) =&gt; a -&gt; b -&gt; Bool
        {-# SPECIALISE f :: (Ix p, Ix q) =&gt; Int -&gt; (p,q) -&gt; Bool #-}
        f = &lt;poly_rhs&gt;

From this the typechecker generates

    AbsBinds [ab] [d1,d2] [([ab], f, f_mono, prags)] binds

    SpecPrag (wrap_fn :: forall a b. (Eq a, Ix b) =&gt; XXX
                      -&gt; forall p q. (Ix p, Ix q) =&gt; XXX[ Int/a, (p,q)/b ])

From these we generate:

    Rule:       forall p, q, (dp:Ix p), (dq:Ix q).
                    f Int (p,q) dInt ($dfInPair dp dq) = f_spec p q dp dq

    Spec bind:  f_spec = wrap_fn &lt;poly_rhs&gt;

Note that

  * The LHS of the rule may mention dictionary *expressions* (eg
    $dfIxPair dp dq), and that is essential because the dp, dq are
    needed on the RHS.

  * The RHS of f_spec, &lt;poly_rhs&gt; has a *copy* of 'binds', so that it
    can fully specialise it.

From the TcSpecPrag, in GHC.HsToCore.Binds we generate a binding for f_spec and a RULE:

   f_spec :: Int -&gt; b -&gt; Int
   f_spec = wrap&lt;f rhs&gt;

   RULE: forall b (d:Num b). f b d = f_spec b

The RULE is generated by taking apart the HsWrapper, which is a little
delicate, but works.

Some wrinkles

1. In tcSpecWrapper, rather than calling tcSubType, we directly call
   skolemise/instantiate.  That is mainly because of wrinkle (2).

   Historical note: in the past, tcSubType did co/contra stuff, which
   could generate too complex a LHS for the RULE, which was another
   reason for not using tcSubType.  But that reason has gone away
   with simple subsumption (#17775).

2. We need to take care with type families (#5821).  Consider
      type instance F Int = Bool
      f :: Num a =&gt; a -&gt; F a
      {-# SPECIALISE foo :: Int -&gt; Bool #-}

  We *could* try to generate an f_spec with precisely the declared type:
      f_spec :: Int -&gt; Bool
      f_spec = &lt;f rhs&gt; Int dNumInt |&gt; co

      RULE: forall d. f Int d = f_spec |&gt; sym co

  but the 'co' and 'sym co' are (a) playing no useful role, and (b) are
  hard to generate.  At all costs we must avoid this:
      RULE: forall d. f Int d |&gt; co = f_spec
  because the LHS will never match (indeed it's rejected in
  decomposeRuleLhs).

  So we simply do this:
    - Generate a constraint to check that the specialised type (after
      skolemisation) is equal to the instantiated function type.
    - But *discard* the evidence (coercion) for that constraint,
      so that we ultimately generate the simpler code
          f_spec :: Int -&gt; F Int
          f_spec = &lt;f rhs&gt; Int dNumInt

          RULE: forall d. f Int d = f_spec
      You can see this discarding happening in tcSpecPrag

3. Note that the HsWrapper can transform *any* function with the right
   type prefix
       forall ab. (Eq a, Ix b) =&gt; XXX
   regardless of XXX.  It's sort of polymorphic in XXX.  This is
   useful: we use the same wrapper to transform each of the class ops, as
   well as the dict.  That's what goes on in GHC.Tc.TyCl.Instance.mk_meth_spec_prags
-}</span><span>
</span><span id="line-729"></span><span>
</span><span id="line-730"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSpecPrags"><span class="hs-identifier hs-type">tcSpecPrags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-731"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LTcSpecPrag"><span class="hs-identifier hs-type">LTcSpecPrag</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-732"></span><span class="hs-comment">-- Add INLINE and SPECIALSE pragmas</span><span>
</span><span id="line-733"></span><span class="hs-comment">--    INLINE prags are added to the (polymorphic) Id directly</span><span>
</span><span id="line-734"></span><span class="hs-comment">--    SPECIALISE prags are passed to the desugarer via TcSpecPrags</span><span>
</span><span id="line-735"></span><span class="hs-comment">-- Pre-condition: the poly_id is zonked</span><span>
</span><span id="line-736"></span><span class="hs-comment">-- Reason: required by tcSubExp</span><span>
</span><span id="line-737"></span><span id="tcSpecPrags"><span class="annot"><span class="annottext">tcSpecPrags :: TcId -&gt; [LSig GhcRn] -&gt; TcM [LTcSpecPrag]
</span><a href="GHC.Tc.Gen.Sig.html#tcSpecPrags"><span class="hs-identifier hs-var hs-var">tcSpecPrags</span></a></span></span><span> </span><span id="local-6989586621681117634"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117634"><span class="hs-identifier hs-var">poly_id</span></a></span></span><span> </span><span id="local-6989586621681117633"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117633"><span class="hs-identifier hs-var">prag_sigs</span></a></span></span><span>
</span><span id="line-738"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcSpecPrags&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117634"><span class="hs-identifier hs-var">poly_id</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117632"><span class="hs-identifier hs-var">spec_sigs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-739"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LSig GhcRn] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117631"><span class="hs-identifier hs-var">bad_sigs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcRn ()
</span><a href="#local-6989586621681117630"><span class="hs-identifier hs-var">warn_discarded_sigs</span></a></span><span>
</span><span id="line-740"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117629"><span class="annot"><span class="annottext">[Located [TcSpecPrag]]
</span><a href="#local-6989586621681117629"><span class="hs-identifier hs-var">pss</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; TcRn (Located [TcSpecPrag]))
-&gt; [LSig GhcRn] -&gt; TcRn [Located [TcSpecPrag]]
forall a b. (a -&gt; TcRn b) -&gt; [a] -&gt; TcRn [b]
</span><a href="GHC.Tc.Utils.Monad.html#mapAndRecoverM"><span class="hs-identifier hs-var">mapAndRecoverM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Sig GhcRn -&gt; TcM [TcSpecPrag])
-&gt; LSig GhcRn -&gt; TcRn (Located [TcSpecPrag])
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM (Located b)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocM"><span class="hs-identifier hs-var">wrapLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; Sig GhcRn -&gt; TcM [TcSpecPrag]
</span><a href="GHC.Tc.Gen.Sig.html#tcSpecPrag"><span class="hs-identifier hs-var">tcSpecPrag</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117634"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117632"><span class="hs-identifier hs-var">spec_sigs</span></a></span><span>
</span><span id="line-741"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[LTcSpecPrag] -&gt; TcM [LTcSpecPrag]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([LTcSpecPrag] -&gt; TcM [LTcSpecPrag])
-&gt; [LTcSpecPrag] -&gt; TcM [LTcSpecPrag]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Located [TcSpecPrag] -&gt; [LTcSpecPrag])
-&gt; [Located [TcSpecPrag]] -&gt; [LTcSpecPrag]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117624"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117624"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681117623"><span class="annot"><span class="annottext">[TcSpecPrag]
</span><a href="#local-6989586621681117623"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(TcSpecPrag -&gt; LTcSpecPrag) -&gt; [TcSpecPrag] -&gt; [LTcSpecPrag]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; TcSpecPrag -&gt; LTcSpecPrag
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117624"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TcSpecPrag]
</span><a href="#local-6989586621681117623"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located [TcSpecPrag]]
</span><a href="#local-6989586621681117629"><span class="hs-identifier hs-var">pss</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-742"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-743"></span><span>    </span><span id="local-6989586621681117632"><span class="annot"><span class="annottext">spec_sigs :: [LSig GhcRn]
</span><a href="#local-6989586621681117632"><span class="hs-identifier hs-var hs-var">spec_sigs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; Bool) -&gt; [LSig GhcRn] -&gt; [LSig GhcRn]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn -&gt; Bool
forall name. LSig name -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isSpecLSig"><span class="hs-identifier hs-var">isSpecLSig</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117633"><span class="hs-identifier hs-var">prag_sigs</span></a></span><span>
</span><span id="line-744"></span><span>    </span><span id="local-6989586621681117631"><span class="annot"><span class="annottext">bad_sigs :: [LSig GhcRn]
</span><a href="#local-6989586621681117631"><span class="hs-identifier hs-var hs-var">bad_sigs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; Bool) -&gt; [LSig GhcRn] -&gt; [LSig GhcRn]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn -&gt; Bool
forall name. LSig name -&gt; Bool
</span><a href="#local-6989586621681117621"><span class="hs-identifier hs-var">is_bad_sig</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117633"><span class="hs-identifier hs-var">prag_sigs</span></a></span><span>
</span><span id="line-745"></span><span>    </span><span id="local-6989586621681117621"><span class="annot"><span class="annottext">is_bad_sig :: LSig name -&gt; Bool
</span><a href="#local-6989586621681117621"><span class="hs-identifier hs-var hs-var">is_bad_sig</span></a></span></span><span> </span><span id="local-6989586621681117620"><span class="annot"><span class="annottext">LSig name
</span><a href="#local-6989586621681117620"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LSig name -&gt; Bool
forall name. LSig name -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isSpecLSig"><span class="hs-identifier hs-var">isSpecLSig</span></a></span><span> </span><span class="annot"><span class="annottext">LSig name
</span><a href="#local-6989586621681117620"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">LSig name -&gt; Bool
forall name. LSig name -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isInlineLSig"><span class="hs-identifier hs-var">isInlineLSig</span></a></span><span> </span><span class="annot"><span class="annottext">LSig name
</span><a href="#local-6989586621681117620"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">LSig name -&gt; Bool
forall name. LSig name -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isSCCFunSig"><span class="hs-identifier hs-var">isSCCFunSig</span></a></span><span> </span><span class="annot"><span class="annottext">LSig name
</span><a href="#local-6989586621681117620"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-746"></span><span>
</span><span id="line-747"></span><span>    </span><span id="local-6989586621681117630"><span class="annot"><span class="annottext">warn_discarded_sigs :: TcRn ()
</span><a href="#local-6989586621681117630"><span class="hs-identifier hs-var hs-var">warn_discarded_sigs</span></a></span></span><span>
</span><span id="line-748"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarnTc"><span class="hs-identifier hs-var">addWarnTc</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span>
</span><span id="line-749"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Discarding unexpected pragmas for&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117634"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-750"></span><span>                      </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; SDoc) -&gt; [LSig GhcRn] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">(SrcSpan -&gt; SDoc) -&gt; (LSig GhcRn -&gt; SrcSpan) -&gt; LSig GhcRn -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117631"><span class="hs-identifier hs-var">bad_sigs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-753"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSpecPrag"><span class="hs-identifier hs-type">tcSpecPrag</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#Sig"><span class="hs-identifier hs-type">Sig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#TcSpecPrag"><span class="hs-identifier hs-type">TcSpecPrag</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-754"></span><span id="tcSpecPrag"><span class="annot"><span class="annottext">tcSpecPrag :: TcId -&gt; Sig GhcRn -&gt; TcM [TcSpecPrag]
</span><a href="GHC.Tc.Gen.Sig.html#tcSpecPrag"><span class="hs-identifier hs-var hs-var">tcSpecPrag</span></a></span></span><span> </span><span id="local-6989586621681117614"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117614"><span class="hs-identifier hs-var">poly_id</span></a></span></span><span> </span><span id="local-6989586621681117613"><span class="annot"><span class="annottext">prag :: Sig GhcRn
</span><a href="#local-6989586621681117613"><span class="hs-identifier hs-var">prag</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-type">SpecSig</span></a></span><span> </span><span class="annot"><span class="annottext">XSpecSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117612"><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><a href="#local-6989586621681117612"><span class="hs-identifier hs-var">fun_name</span></a></span></span><span> </span><span id="local-6989586621681117611"><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><a href="#local-6989586621681117611"><span class="hs-identifier hs-var">hs_tys</span></a></span></span><span> </span><span id="local-6989586621681117610"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117610"><span class="hs-identifier hs-var">inl</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-755"></span><span class="hs-comment">-- See Note [Handling SPECIALISE pragmas]</span><span>
</span><span id="line-756"></span><span class="hs-comment">--</span><span>
</span><span id="line-757"></span><span class="hs-comment">-- The Name fun_name in the SpecSig may not be the same as that of the poly_id</span><span>
</span><span id="line-758"></span><span class="hs-comment">-- Example: SPECIALISE for a class method: the Name in the SpecSig is</span><span>
</span><span id="line-759"></span><span class="hs-comment">--          for the selector Id, but the poly_id is something like $cop</span><span>
</span><span id="line-760"></span><span class="hs-comment">-- However we want to use fun_name in the error message, since that is</span><span>
</span><span id="line-761"></span><span class="hs-comment">-- what the user wrote (#8537)</span><span>
</span><span id="line-762"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcM [TcSpecPrag] -&gt; TcM [TcSpecPrag]
forall a. SDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Sig GhcRn -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="#local-6989586621681117608"><span class="hs-identifier hs-var">spec_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681117613"><span class="hs-identifier hs-var">prag</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM [TcSpecPrag] -&gt; TcM [TcSpecPrag])
-&gt; TcM [TcSpecPrag] -&gt; TcM [TcSpecPrag]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-763"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#warnIf"><span class="hs-identifier hs-var">warnIf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#isOverloadedTy"><span class="hs-identifier hs-var">isOverloadedTy</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117605"><span class="hs-identifier hs-var">poly_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; Bool
</span><a href="GHC.Types.Basic.html#isInlinePragma"><span class="hs-identifier hs-var">isInlinePragma</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117610"><span class="hs-identifier hs-var">inl</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-764"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;SPECIALISE pragma for non-overloaded function&quot;</span></span><span>
</span><span id="line-765"></span><span>                  </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681117612"><span class="hs-identifier hs-var">fun_name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-766"></span><span>                  </span><span class="hs-comment">-- Note [SPECIALISE pragmas]</span><span>
</span><span id="line-767"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117602"><span class="annot"><span class="annottext">[TcSpecPrag]
</span><a href="#local-6989586621681117602"><span class="hs-identifier hs-var">spec_prags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LHsSigType GhcRn -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcSpecPrag)
-&gt; [LHsSigType GhcRn] -&gt; TcM [TcSpecPrag]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcSpecPrag
</span><a href="#local-6989586621681117601"><span class="hs-identifier hs-var">tc_one</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><a href="#local-6989586621681117611"><span class="hs-identifier hs-var">hs_tys</span></a></span><span>
</span><span id="line-768"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcSpecPrag&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117614"><span class="hs-identifier hs-var">poly_id</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcSpecPrag -&gt; SDoc) -&gt; [TcSpecPrag] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TcSpecPrag -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[TcSpecPrag]
</span><a href="#local-6989586621681117602"><span class="hs-identifier hs-var">spec_prags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-769"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcSpecPrag] -&gt; TcM [TcSpecPrag]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[TcSpecPrag]
</span><a href="#local-6989586621681117602"><span class="hs-identifier hs-var">spec_prags</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-770"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-771"></span><span>    </span><span id="local-6989586621681117599"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681117599"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117614"><span class="hs-identifier hs-var">poly_id</span></a></span><span>
</span><span id="line-772"></span><span>    </span><span id="local-6989586621681117605"><span class="annot"><span class="annottext">poly_ty :: Kind
</span><a href="#local-6989586621681117605"><span class="hs-identifier hs-var hs-var">poly_ty</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117614"><span class="hs-identifier hs-var">poly_id</span></a></span><span>
</span><span id="line-773"></span><span>    </span><span id="local-6989586621681117608"><span class="annot"><span class="annottext">spec_ctxt :: a -&gt; SDoc
</span><a href="#local-6989586621681117608"><span class="hs-identifier hs-var hs-var">spec_ctxt</span></a></span></span><span> </span><span id="local-6989586621681117596"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681117596"><span class="hs-identifier hs-var">prag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the pragma:&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681117596"><span class="hs-identifier hs-var">prag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-774"></span><span>
</span><span id="line-775"></span><span>    </span><span id="local-6989586621681117601"><span class="annot"><span class="annottext">tc_one :: LHsSigType GhcRn -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcSpecPrag
</span><a href="#local-6989586621681117601"><span class="hs-identifier hs-var hs-var">tc_one</span></a></span></span><span> </span><span id="local-6989586621681117595"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681117595"><span class="hs-identifier hs-var">hs_ty</span></a></span></span><span>
</span><span id="line-776"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681117594"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117594"><span class="hs-identifier hs-var">spec_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; LHsSigType GhcRn -&gt; TcM Kind
</span><a href="GHC.Tc.Gen.HsType.html#tcHsSigType"><span class="hs-identifier hs-var">tcHsSigType</span></a></span><span>   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Bool -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#FunSigCtxt"><span class="hs-identifier hs-var">FunSigCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117599"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681117595"><span class="hs-identifier hs-var">hs_ty</span></a></span><span>
</span><span id="line-777"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117592"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681117592"><span class="hs-identifier hs-var">wrap</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; Kind -&gt; Kind -&gt; TcM HsWrapper
</span><a href="GHC.Tc.Gen.Sig.html#tcSpecWrapper"><span class="hs-identifier hs-var">tcSpecWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Bool -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#FunSigCtxt"><span class="hs-identifier hs-var">FunSigCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117599"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117605"><span class="hs-identifier hs-var">poly_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117594"><span class="hs-identifier hs-var">spec_ty</span></a></span><span>
</span><span id="line-778"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcSpecPrag -&gt; IOEnv (Env TcGblEnv TcLclEnv) TcSpecPrag
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; HsWrapper -&gt; InlinePragma -&gt; TcSpecPrag
</span><a href="GHC.Hs.Binds.html#SpecPrag"><span class="hs-identifier hs-var">SpecPrag</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117614"><span class="hs-identifier hs-var">poly_id</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681117592"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681117610"><span class="hs-identifier hs-var">inl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-779"></span><span>
</span><span id="line-780"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSpecPrag"><span class="hs-identifier hs-var">tcSpecPrag</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117590"><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681117590"><span class="hs-identifier hs-var">prag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM [TcSpecPrag]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcSpecPrag&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Sig GhcRn -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681117590"><span class="hs-identifier hs-var">prag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-781"></span><span>
</span><span id="line-782"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-783"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcSpecWrapper"><span class="hs-identifier hs-type">tcSpecWrapper</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html#UserTypeCtxt"><span class="hs-identifier hs-type">UserTypeCtxt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#HsWrapper"><span class="hs-identifier hs-type">HsWrapper</span></a></span><span>
</span><span id="line-784"></span><span class="hs-comment">-- A simpler variant of tcSubType, used for SPECIALISE pragmas</span><span>
</span><span id="line-785"></span><span class="hs-comment">-- See Note [Handling SPECIALISE pragmas], wrinkle 1</span><span>
</span><span id="line-786"></span><span id="tcSpecWrapper"><span class="annot"><span class="annottext">tcSpecWrapper :: UserTypeCtxt -&gt; Kind -&gt; Kind -&gt; TcM HsWrapper
</span><a href="GHC.Tc.Gen.Sig.html#tcSpecWrapper"><span class="hs-identifier hs-var hs-var">tcSpecWrapper</span></a></span></span><span> </span><span id="local-6989586621681117587"><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117587"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681117586"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117586"><span class="hs-identifier hs-var">poly_ty</span></a></span></span><span> </span><span id="local-6989586621681117585"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117585"><span class="hs-identifier hs-var">spec_ty</span></a></span></span><span>
</span><span id="line-787"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117584"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681117584"><span class="hs-identifier hs-var">sk_wrap</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117583"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681117583"><span class="hs-identifier hs-var">inst_wrap</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-788"></span><span>               </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
-&gt; Kind -&gt; (Kind -&gt; TcM HsWrapper) -&gt; TcM (HsWrapper, HsWrapper)
forall result.
UserTypeCtxt
-&gt; Kind -&gt; (Kind -&gt; TcM result) -&gt; TcM (HsWrapper, result)
</span><a href="GHC.Tc.Utils.Unify.html#tcSkolemise"><span class="hs-identifier hs-var">tcSkolemise</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117587"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117585"><span class="hs-identifier hs-var">spec_ty</span></a></span><span> </span><span class="annot"><span class="annottext">((Kind -&gt; TcM HsWrapper) -&gt; TcM (HsWrapper, HsWrapper))
-&gt; (Kind -&gt; TcM HsWrapper) -&gt; TcM (HsWrapper, HsWrapper)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681117582"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117582"><span class="hs-identifier hs-var">spec_tau</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-789"></span><span>                  </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117581"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681117581"><span class="hs-identifier hs-var">inst_wrap</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117580"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117580"><span class="hs-identifier hs-var">tau</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin -&gt; Kind -&gt; TcM (HsWrapper, Kind)
</span><a href="GHC.Tc.Utils.Instantiate.html#topInstantiate"><span class="hs-identifier hs-var">topInstantiate</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="#local-6989586621681117579"><span class="hs-identifier hs-var">orig</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117586"><span class="hs-identifier hs-var">poly_ty</span></a></span><span>
</span><span id="line-790"></span><span>                     </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TcCoercionN
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (HsExpr GhcRn) -&gt; Kind -&gt; Kind -&gt; TcM TcCoercionN
</span><a href="GHC.Tc.Utils.Unify.html#unifyType"><span class="hs-identifier hs-var">unifyType</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (HsExpr GhcRn)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117582"><span class="hs-identifier hs-var">spec_tau</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681117580"><span class="hs-identifier hs-var">tau</span></a></span><span>
</span><span id="line-791"></span><span>                            </span><span class="hs-comment">-- Deliberately ignore the evidence</span><span>
</span><span id="line-792"></span><span>                            </span><span class="hs-comment">-- See Note [Handling SPECIALISE pragmas],</span><span>
</span><span id="line-793"></span><span>                            </span><span class="hs-comment">--   wrinkle (2)</span><span>
</span><span id="line-794"></span><span>                     </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; TcM HsWrapper
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681117581"><span class="hs-identifier hs-var">inst_wrap</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-795"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; TcM HsWrapper
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681117584"><span class="hs-identifier hs-var">sk_wrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681117583"><span class="hs-identifier hs-var">inst_wrap</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-796"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-797"></span><span>    </span><span id="local-6989586621681117579"><span class="annot"><span class="annottext">orig :: CtOrigin
</span><a href="#local-6989586621681117579"><span class="hs-identifier hs-var hs-var">orig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#SpecPragOrigin"><span class="hs-identifier hs-var">SpecPragOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681117587"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-798"></span><span>
</span><span id="line-799"></span><span class="hs-comment">--------------</span><span>
</span><span id="line-800"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcImpPrags"><span class="hs-identifier hs-type">tcImpPrags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LTcSpecPrag"><span class="hs-identifier hs-type">LTcSpecPrag</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-801"></span><span class="hs-comment">-- SPECIALISE pragmas for imported things</span><span>
</span><span id="line-802"></span><span id="tcImpPrags"><span class="annot"><span class="annottext">tcImpPrags :: [LSig GhcRn] -&gt; TcM [LTcSpecPrag]
</span><a href="GHC.Tc.Gen.Sig.html#tcImpPrags"><span class="hs-identifier hs-var hs-var">tcImpPrags</span></a></span></span><span> </span><span id="local-6989586621681117577"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117577"><span class="hs-identifier hs-var">prags</span></a></span></span><span>
</span><span id="line-803"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681117576"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681117576"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-804"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681117575"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681117575"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-805"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="#local-6989586621681117573"><span class="hs-identifier hs-var">not_specialising</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681117575"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-806"></span><span>            </span><span class="annot"><span class="annottext">[LTcSpecPrag] -&gt; TcM [LTcSpecPrag]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-807"></span><span>         </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-808"></span><span>            </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681117572"><span class="annot"><span class="annottext">[Located [TcSpecPrag]]
</span><a href="#local-6989586621681117572"><span class="hs-identifier hs-var">pss</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located (Name, Sig GhcRn) -&gt; TcRn (Located [TcSpecPrag]))
-&gt; [Located (Name, Sig GhcRn)] -&gt; TcRn [Located [TcSpecPrag]]
forall a b. (a -&gt; TcRn b) -&gt; [a] -&gt; TcRn [b]
</span><a href="GHC.Tc.Utils.Monad.html#mapAndRecoverM"><span class="hs-identifier hs-var">mapAndRecoverM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Name, Sig GhcRn) -&gt; TcM [TcSpecPrag])
-&gt; Located (Name, Sig GhcRn) -&gt; TcRn (Located [TcSpecPrag])
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM (Located b)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocM"><span class="hs-identifier hs-var">wrapLocM</span></a></span><span> </span><span class="annot"><span class="annottext">(Name, Sig GhcRn) -&gt; TcM [TcSpecPrag]
</span><a href="GHC.Tc.Gen.Sig.html#tcImpSpec"><span class="hs-identifier hs-var">tcImpSpec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-809"></span><span>                     </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan -&gt; (Name, Sig GhcRn) -&gt; Located (Name, Sig GhcRn)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117570"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681117569"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681117568"><span class="hs-identifier hs-var">prag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-810"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117570"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117570"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681117568"><span class="annot"><span class="annottext">prag :: Sig GhcRn
</span><a href="#local-6989586621681117568"><span class="hs-identifier hs-var">prag</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-type">SpecSig</span></a></span><span> </span><span class="annot"><span class="annottext">XSpecSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681117569"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681117569"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681117577"><span class="hs-identifier hs-var">prags</span></a></span><span>
</span><span id="line-811"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681117576"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681117569"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-812"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[LTcSpecPrag] -&gt; TcM [LTcSpecPrag]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([LTcSpecPrag] -&gt; TcM [LTcSpecPrag])
-&gt; [LTcSpecPrag] -&gt; TcM [LTcSpecPrag]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Located [TcSpecPrag] -&gt; [LTcSpecPrag])
-&gt; [Located [TcSpecPrag]] -&gt; [LTcSpecPrag]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681117566"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117566"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681117565"><span class="annot"><span class="annottext">[TcSpecPrag]
</span><a href="#local-6989586621681117565"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(TcSpecPrag -&gt; LTcSpecPrag) -&gt; [TcSpecPrag] -&gt; [LTcSpecPrag]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; TcSpecPrag -&gt; LTcSpecPrag
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681117566"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TcSpecPrag]
</span><a href="#local-6989586621681117565"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located [TcSpecPrag]]
</span><a href="#local-6989586621681117572"><span class="hs-identifier hs-var">pss</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-813"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-814"></span><span>    </span><span class="hs-comment">-- Ignore SPECIALISE pragmas for imported things</span><span>
</span><span id="line-815"></span><span>    </span><span class="hs-comment">-- when we aren't specialising, or when we aren't generating</span><span>
</span><span id="line-816"></span><span>    </span><span class="hs-comment">-- code.  The latter happens when Haddocking the base library;</span><span>
</span><span id="line-817"></span><span>    </span><span class="hs-comment">-- we don't want complaints about lack of INLINABLE pragmas</span><span>
</span><span id="line-818"></span><span>    </span><span id="local-6989586621681117573"><span class="annot"><span class="annottext">not_specialising :: DynFlags -&gt; Bool
</span><a href="#local-6989586621681117573"><span class="hs-identifier hs-var hs-var">not_specialising</span></a></span></span><span> </span><span id="local-6989586621681117564"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681117564"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>
</span><span id="line-819"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_Specialise"><span class="hs-identifier hs-var">Opt_Specialise</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681117564"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-820"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget
</span><a href="GHC.Driver.Session.html#hscTarget"><span class="hs-identifier hs-var hs-var">hscTarget</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681117564"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-821"></span><span>                      </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscNothing"><span class="hs-identifier hs-var">HscNothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-822"></span><span>                      </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscInterpreted"><span class="hs-identifier hs-var">HscInterpreted</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-823"></span><span>                      </span><span id="local-6989586621681117558"><span class="annot"><span class="annottext">HscTarget
</span><a href="#local-6989586621681117558"><span class="hs-identifier hs-var">_other</span></a></span></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-824"></span><span>
</span><span id="line-825"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#tcImpSpec"><span class="hs-identifier hs-type">tcImpSpec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#Sig"><span class="hs-identifier hs-type">Sig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#TcSpecPrag"><span class="hs-identifier hs-type">TcSpecPrag</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-826"></span><span id="tcImpSpec"><span class="annot"><span class="annottext">tcImpSpec :: (Name, Sig GhcRn) -&gt; TcM [TcSpecPrag]
</span><a href="GHC.Tc.Gen.Sig.html#tcImpSpec"><span class="hs-identifier hs-var hs-var">tcImpSpec</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681117557"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117557"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681117556"><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681117556"><span class="hs-identifier hs-var">prag</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-827"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681117555"><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117555"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM TcId
</span><a href="GHC.Tc.Utils.Env.html#tcLookupId"><span class="hs-identifier hs-var">tcLookupId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117557"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-828"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; Bool
</span><a href="GHC.Types.Basic.html#isAnyInlinePragma"><span class="hs-identifier hs-var">isAnyInlinePragma</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcId -&gt; InlinePragma
</span><a href="GHC.Types.Id.html#idInlinePragma"><span class="hs-identifier hs-var">idInlinePragma</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117555"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-829"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">TcId -&gt; Sig GhcRn -&gt; TcM [TcSpecPrag]
</span><a href="GHC.Tc.Gen.Sig.html#tcSpecPrag"><span class="hs-identifier hs-var">tcSpecPrag</span></a></span><span> </span><span class="annot"><span class="annottext">TcId
</span><a href="#local-6989586621681117555"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681117556"><span class="hs-identifier hs-var">prag</span></a></span><span>
</span><span id="line-830"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarnTc"><span class="hs-identifier hs-var">addWarnTc</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
</span><a href="GHC.Tc.Gen.Sig.html#impSpecErr"><span class="hs-identifier hs-var">impSpecErr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117557"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-831"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcSpecPrag] -&gt; TcM [TcSpecPrag]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-832"></span><span>      </span><span class="hs-comment">-- If there is no INLINE/INLINABLE pragma there will be no unfolding. In</span><span>
</span><span id="line-833"></span><span>      </span><span class="hs-comment">-- that case, just delete the SPECIALISE pragma altogether, lest the</span><span>
</span><span id="line-834"></span><span>      </span><span class="hs-comment">-- desugarer fall over because it can't find the unfolding. See #18118.</span><span>
</span><span id="line-835"></span><span>
</span><span id="line-836"></span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#impSpecErr"><span class="hs-identifier hs-type">impSpecErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-837"></span><span id="impSpecErr"><span class="annot"><span class="annottext">impSpecErr :: Name -&gt; SDoc
</span><a href="GHC.Tc.Gen.Sig.html#impSpecErr"><span class="hs-identifier hs-var hs-var">impSpecErr</span></a></span></span><span> </span><span id="local-6989586621681117552"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117552"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-838"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;You cannot SPECIALISE&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117552"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-839"></span><span>       </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;because its definition has no INLINE/INLINABLE pragma&quot;</span></span><span>
</span><span id="line-840"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span>
</span><span id="line-841"></span><span>                   </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;or its defining module&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681117550"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-842"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;was compiled without -O&quot;</span></span><span class="hs-special">]</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-843"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-844"></span><span>    </span><span id="local-6989586621681117550"><span class="annot"><span class="annottext">mod :: Module
</span><a href="#local-6989586621681117550"><span class="hs-identifier hs-var hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Module
Name -&gt; Module
</span><a href="GHC.Types.Name.html#nameModule"><span class="hs-identifier hs-var">nameModule</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681117552"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-845"></span></pre></body></html>